86 |
86 |
87 # AdBlock |
87 # AdBlock |
88 if url.scheme() == "abp": |
88 if url.scheme() == "abp": |
89 if WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url): |
89 if WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url): |
90 return False |
90 return False |
|
91 |
|
92 # GreaseMonkey |
|
93 if type_ == QWebEnginePage.NavigationTypeLinkClicked and \ |
|
94 url.toString().endswith(".user.js"): |
|
95 WebBrowserWindow.greaseMonkeyManager().downloadScript(url) |
|
96 return False |
91 |
97 |
92 return QWebEnginePage.acceptNavigationRequest(self, url, type_, |
98 return QWebEnginePage.acceptNavigationRequest(self, url, type_, |
93 isMainFrame) |
99 isMainFrame) |
94 |
100 |
95 @pyqtSlot(QUrl) |
101 @pyqtSlot(QUrl) |