WebBrowser/WebBrowserWindow.py

changeset 5031
e4dbcb22d912
parent 5015
ca1d44f0f6b2
child 5033
d1c2651060ec
--- a/WebBrowser/WebBrowserWindow.py	Tue Jul 12 12:48:11 2016 +0200
+++ b/WebBrowser/WebBrowserWindow.py	Tue Jul 12 14:40:23 2016 +0200
@@ -508,6 +508,17 @@
         settings.setAttribute(
             QWebEngineSettings.FullScreenSupportEnabled,
             Preferences.getWebBrowser("FullScreenSupportEnabled"))
+        
+        try:
+            # Qt 5.7
+            settings.setAttribute(
+                QWebEngineSettings.ScreenCaptureEnabled,
+                Preferences.getWebBrowser("ScreenCaptureEnabled"))
+            settings.setAttribute(
+                QWebEngineSettings.WebGLEnabled,
+                Preferences.getWebBrowser("WebGLEnabled"))
+        except (AttributeError, KeyError):
+            pass
     
     def __initActions(self):
         """
@@ -3229,9 +3240,12 @@
             if favicons:
                 self.__clearIconsDatabase()
             if cache:
-                cachePath = self.webProfile().cachePath()
-                if cachePath:
-                    shutil.rmtree(cachePath)
+                try:
+                    self.webProfile().clearHttpCache()
+                except AttributeError:
+                    cachePath = self.webProfile().cachePath()
+                    if cachePath:
+                        shutil.rmtree(cachePath)
             if cookies:
                 self.cookieJar().clear()
                 self.webProfile().cookieStore().deleteAllCookies()

eric ide

mercurial