42 from .Network.NetworkAccessManagerProxy import NetworkAccessManagerProxy |
42 from .Network.NetworkAccessManagerProxy import NetworkAccessManagerProxy |
43 |
43 |
44 from .OpenSearch.OpenSearchEngineAction import OpenSearchEngineAction |
44 from .OpenSearch.OpenSearchEngineAction import OpenSearchEngineAction |
45 from .OpenSearch.OpenSearchEngine import OpenSearchEngine |
45 from .OpenSearch.OpenSearchEngine import OpenSearchEngine |
46 |
46 |
|
47 from .WebPlugins.WebPluginFactory import WebPluginFactory |
|
48 |
47 ########################################################################################## |
49 ########################################################################################## |
48 |
50 |
49 |
51 |
50 class JavaScriptExternalObject(QObject): |
52 class JavaScriptExternalObject(QObject): |
51 """ |
53 """ |
155 |
157 |
156 class HelpWebPage(QWebPage): |
158 class HelpWebPage(QWebPage): |
157 """ |
159 """ |
158 Class implementing an enhanced web page. |
160 Class implementing an enhanced web page. |
159 """ |
161 """ |
|
162 _webPluginFactory = None |
|
163 |
160 def __init__(self, parent=None): |
164 def __init__(self, parent=None): |
161 """ |
165 """ |
162 Constructor |
166 Constructor |
163 |
167 |
164 @param parent parent widget of this window (QWidget) |
168 @param parent parent widget of this window (QWidget) |
165 """ |
169 """ |
166 super().__init__(parent) |
170 super().__init__(parent) |
|
171 |
|
172 self.setPluginFactory(self.webPluginFactory()) |
167 |
173 |
168 self.__lastRequest = None |
174 self.__lastRequest = None |
169 self.__lastRequestType = QWebPage.NavigationTypeOther |
175 self.__lastRequestType = QWebPage.NavigationTypeOther |
170 |
176 |
171 self.__proxy = NetworkAccessManagerProxy(self) |
177 self.__proxy = NetworkAccessManagerProxy(self) |
452 for cert in certList: |
458 for cert in certList: |
453 if not cert.isValid(): |
459 if not cert.isValid(): |
454 return False |
460 return False |
455 |
461 |
456 return True |
462 return True |
|
463 |
|
464 @classmethod |
|
465 def webPluginFactory(cls): |
|
466 """ |
|
467 Class method to get a reference to the web plug-in factory instance. |
|
468 |
|
469 @return reference to the web plug-in factory instance (WebPluginFactory |
|
470 """ |
|
471 if cls._webPluginFactory is None: |
|
472 cls._webPluginFactory = WebPluginFactory() |
|
473 |
|
474 return cls._webPluginFactory |
457 |
475 |
458 ########################################################################################## |
476 ########################################################################################## |
459 |
477 |
460 |
478 |
461 class HelpBrowser(QWebView): |
479 class HelpBrowser(QWebView): |
1520 @param ok flag indicating the result (boolean) |
1538 @param ok flag indicating the result (boolean) |
1521 """ |
1539 """ |
1522 self.__isLoading = False |
1540 self.__isLoading = False |
1523 self.__progress = 0 |
1541 self.__progress = 0 |
1524 |
1542 |
|
1543 if Preferences.getHelp("ClickToFlashEnabled"): |
|
1544 # this is a hack to make the ClickToFlash button appear |
|
1545 self.zoomIn() |
|
1546 self.zoomOut() |
|
1547 |
1525 if ok: |
1548 if ok: |
1526 self.mw.adblockManager().page().applyRulesToPage(self.page()) |
1549 self.mw.adblockManager().page().applyRulesToPage(self.page()) |
1527 self.mw.passwordManager().fill(self.page()) |
1550 self.mw.passwordManager().fill(self.page()) |
1528 |
1551 |
1529 def isLoading(self): |
1552 def isLoading(self): |