Sat, 02 Apr 2016 18:41:47 +0200
Continued porting the web browser.
- Only download GreaseMonkey script if user clicked the link.
WebBrowser/GreaseMonkey/GreaseMonkeyUrlInterceptor.py | file | annotate | diff | comparison | revisions |
--- 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)