WebBrowser/WebBrowserPage.py

branch
maintenance
changeset 5730
6422afc7adc4
parent 5716
27a7c7064686
child 5736
000ea446ff4b
--- a/WebBrowser/WebBrowserPage.py	Sun Apr 09 16:52:55 2017 +0200
+++ b/WebBrowser/WebBrowserPage.py	Sat May 06 13:43:21 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