WebBrowser: Some little changes to increase stability.

Tue, 05 Jun 2018 19:14:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 05 Jun 2018 19:14:10 +0200
changeset 6326
5ef9456a0cbe
parent 6325
ebdcf9a36f42
child 6327
a1716d9210f4

WebBrowser: Some little changes to increase stability.

WebBrowser/AdBlock/AdBlockManager.py file | annotate | diff | comparison | revisions
WebBrowser/GreaseMonkey/GreaseMonkeyJavaScript.py file | annotate | diff | comparison | revisions
--- a/WebBrowser/AdBlock/AdBlockManager.py	Mon Jun 04 19:56:34 2018 +0200
+++ b/WebBrowser/AdBlock/AdBlockManager.py	Tue Jun 05 19:14:10 2018 +0200
@@ -638,10 +638,17 @@
         """
         Private slot to update the adblock matcher.
         """
+        from WebBrowser.WebBrowserWindow import WebBrowserWindow
+        WebBrowserWindow.networkManager().removeUrlInterceptor(
+            self.__interceptor)
+        
         if self.__enabled:
             self.__matcher.update()
         else:
             self.__matcher.clear()
+        
+        WebBrowserWindow.networkManager().installUrlInterceptor(
+            self.__interceptor)
     
     def __canBeBlocked(self, url):
         """
--- a/WebBrowser/GreaseMonkey/GreaseMonkeyJavaScript.py	Mon Jun 04 19:56:34 2018 +0200
+++ b/WebBrowser/GreaseMonkey/GreaseMonkeyJavaScript.py	Tue Jun 05 19:14:10 2018 +0200
@@ -125,7 +125,7 @@
 
 function GM_getValue(aKey, aDefault) {{
     var val = localStorage.getItem("{0}" + aKey)
-    if (null === val && 'undefined' != typeof aDefault) return aDefault;
+    if (null === val) return aDefault;
     return val;
 }}
 

eric ide

mercurial