1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 18:26:34 +01:00

Fixed broken Click2Flash from previous commit.

Broken by mistake in e28f9d438e
This commit is contained in:
nowrep 2013-01-24 00:00:57 +01:00
parent 1fef4efec7
commit 25cf1eedc4
2 changed files with 17 additions and 17 deletions

View File

@ -261,7 +261,7 @@ void AutoFillModel::completePage(WebPage* page)
}
}
}
#include <QDebug>
void AutoFillModel::post(const QNetworkRequest &request, const QByteArray &outgoingData)
{
// Don't save in private browsing

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -219,7 +219,7 @@ void ClickToFlash::load()
else {
/*
Old code caused sometimes flashing of the whole browser window and then somehow
ruined rendering of opacity effects, etc.. in the window on X11.
ruined rendering of opacity effects, etc..
QWebElement substitute = m_element.clone();
substitute.setAttribute(QLatin1String("type"), "application/futuresplash");
@ -228,18 +228,18 @@ void ClickToFlash::load()
So asynchronous JavaScript code is used to remove element from page and then substitute
it with unblocked Flash. The JavaScript code is:
var QzTools::c2f_clone = this.cloneNode(true);
var QzTools::c2f_parentNode = this.parentNode;
var QzTools::c2f_substituteElement = document.createElement(this.tagName);
var qz_c2f_clone = this.cloneNode(true);
var qz_c2f_parentNode = this.parentNode;
var qz_c2f_substituteElement = document.createElement(this.tagName);
QzTools::c2f_substituteElement.width = this.width;
QzTools::c2f_substituteElement.height = this.height;
qz_c2f_substituteElement.width = this.width;
qz_c2f_substituteElement.height = this.height;
this.parentNode.replaceChild(QzTools::c2f_substituteElement, this);
this.parentNode.replaceChild(qz_c2f_substituteElement, this);
setTimeout(function(){
QzTools::c2f_parentNode.replaceChild(QzTools::c2f_clone, QzTools::c2f_substituteElement);
}, 250);
setTimeout(function(){
qz_c2f_parentNode.replaceChild(qz_c2f_clone, qz_c2f_substituteElement);
}, 250);
*/
@ -249,11 +249,11 @@ void ClickToFlash::load()
m_element.setAttribute("type", "application/futuresplash");
QString js = "var QzTools::c2f_clone=this.cloneNode(true);var QzTools::c2f_parentNode=this.parentNode;"
"var QzTools::c2f_substituteElement=document.createElement(this.tagName);"
"QzTools::c2f_substituteElement.width=this.width;QzTools::c2f_substituteElement.height=this.height;"
"this.parentNode.replaceChild(QzTools::c2f_substituteElement,this);setTimeout(function(){"
"QzTools::c2f_parentNode.replaceChild(QzTools::c2f_clone,QzTools::c2f_substituteElement);},250);";
QString js = "var qz_c2f_clone=this.cloneNode(true);var qz_c2f_parentNode=this.parentNode;"
"var qz_c2f_substituteElement=document.createElement(this.tagName);"
"qz_c2f_substituteElement.width=this.width;qz_c2f_substituteElement.height=this.height;"
"this.parentNode.replaceChild(qz_c2f_substituteElement,this);setTimeout(function(){"
"qz_c2f_parentNode.replaceChild(qz_c2f_clone,qz_c2f_substituteElement);},250);";
m_element.evaluateJavaScript(js);
}