Continued porting the web browser. QtWebEngine

Sat, 02 Apr 2016 18:41:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 02 Apr 2016 18:41:47 +0200
branch
QtWebEngine
changeset 4909
a7bede0eb067
parent 4908
f1859c36d564
child 4910
e97af1181efd

Continued porting the web browser.

- Only download GreaseMonkey script if user clicked the link.

WebBrowser/GreaseMonkey/GreaseMonkeyUrlInterceptor.py file | annotate | diff | comparison | revisions
diff -r f1859c36d564 -r a7bede0eb067 WebBrowser/GreaseMonkey/GreaseMonkeyUrlInterceptor.py
--- a/WebBrowser/GreaseMonkey/GreaseMonkeyUrlInterceptor.py	Tue Mar 29 16:49:54 2016 +0200
+++ b/WebBrowser/GreaseMonkey/GreaseMonkeyUrlInterceptor.py	Sat Apr 02 18:41:47 2016 +0200
@@ -9,6 +9,8 @@
 
 from __future__ import unicode_literals
 
+from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo
+
 from ..Network.UrlInterceptor import UrlInterceptor
 
 
@@ -34,6 +36,10 @@
         @param info request info object
         @type QWebEngineUrlRequestInfo
         """
+        if info.navigationType() != \
+                QWebEngineUrlRequestInfo.NavigationTypeLink:
+            return
+        
         if info.requestUrl().toString().endswith(".user.js"):
             self.__manager.downloadScript(info.requestUrl())
             info.block(True)

eric ide

mercurial