Helpviewer/WebPlugins/ClickToFlash/ClickToFlash.py

changeset 2107
1690f30db6f3
parent 2087
795992a5c561
child 2302
f29e9405c851
equal deleted inserted replaced
2106:cca04724bff8 2107:1690f30db6f3
6 """ 6 """
7 Module implementing the Flash blocker. 7 Module implementing the Flash blocker.
8 """ 8 """
9 9
10 10
11 from PyQt4.QtCore import pyqtSlot, QUrl, Qt, QByteArray, QTimer, qVersion 11 from PyQt4.QtCore import pyqtSlot, QUrl, Qt, QByteArray, QTimer
12 from PyQt4.QtGui import QWidget, QMenu, QCursor, QDialog, QLabel, QFormLayout 12 from PyQt4.QtGui import QWidget, QMenu, QCursor, QDialog, QLabel, QFormLayout
13 from PyQt4.QtNetwork import QNetworkRequest 13 from PyQt4.QtNetwork import QNetworkRequest
14 from PyQt4.QtWebKit import QWebHitTestResult, QWebElement, QWebView, QWebElementCollection 14 from PyQt4.QtWebKit import QWebHitTestResult, QWebElement, QWebView, QWebElementCollection
15 15
16 from .Ui_ClickToFlash import Ui_ClickToFlash 16 from .Ui_ClickToFlash import Ui_ClickToFlash
213 if checkString == "": 213 if checkString == "":
214 checkString = element.attribute("data") 214 checkString = element.attribute("data")
215 if checkString == "": 215 if checkString == "":
216 checkString = element.attribute("value") 216 checkString = element.attribute("value")
217 217
218 if qVersion() >= "5.0.0": 218 checkString = view.url().resolved(QUrl(checkString)).toString(
219 checkString = view.url().resolved(QUrl(checkString)).toString( 219 QUrl.RemoveQuery)
220 QUrl.ComponentFormattingOptions(QUrl.RemoveQuery))
221 else:
222 checkString = view.url().resolved(QUrl(checkString)).toString(
223 QUrl.RemoveQuery)
224 return self.__url.toEncoded().contains(QByteArray(checkString.encode("utf-8"))) 220 return self.__url.toEncoded().contains(QByteArray(checkString.encode("utf-8")))
225 221
226 def __checkElement(self, element): 222 def __checkElement(self, element):
227 """ 223 """
228 Private slot to check an element against the saved arguments. 224 Private slot to check an element against the saved arguments.

eric ide

mercurial