WebBrowser/WebBrowserPage.py

changeset 5716
27a7c7064686
parent 5624
cdd346d8858b
child 5736
000ea446ff4b
diff -r cbcca230679f -r 27a7c7064686 WebBrowser/WebBrowserPage.py
--- a/WebBrowser/WebBrowserPage.py	Tue Apr 25 19:20:18 2017 +0200
+++ b/WebBrowser/WebBrowserPage.py	Wed Apr 26 19:06:23 2017 +0200
@@ -89,6 +89,12 @@
             if WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url):
                 return False
         
+        # GreaseMonkey
+        if type_ == QWebEnginePage.NavigationTypeLinkClicked and \
+           url.toString().endswith(".user.js"):
+            WebBrowserWindow.greaseMonkeyManager().downloadScript(url)
+            return False
+        
         return QWebEnginePage.acceptNavigationRequest(self, url, type_,
                                                       isMainFrame)
     

eric ide

mercurial