Tue, 03 Jul 2018 19:57:17 +0200
Webbrowser: continued upgrading to Qt 5.11.
--- a/Preferences/ConfigurationPages/WebBrowserPage.py Tue Jul 03 19:08:29 2018 +0200 +++ b/Preferences/ConfigurationPages/WebBrowserPage.py Tue Jul 03 19:57:17 2018 +0200 @@ -73,6 +73,15 @@ except KeyError: self.screenCaptureCheckBox.setEnabled(False) self.webGLCheckBox.setEnabled(False) + try: + # Qt 5.11 + self.autoplayMediaCheckBox.setChecked( + Preferences.getWebBrowser("PlaybackRequiresUserGesture")) + self.webRtcPublicOnlyCheckBox.setChecked( + Preferences.getWebBrowser("WebRTCPublicInterfacesOnly")) + except KeyError: + self.autoplayMediaCheckBox.setEnabled(False) + self.webRtcPublicOnlyCheckBox.setEnabled(False) self.javaScriptGroup.setChecked( Preferences.getWebBrowser("JavaScriptEnabled")) @@ -85,9 +94,14 @@ "AllowWindowActivationFromJavaScript")) except KeyError: self.jsActivateWindowsCheckBox.setEnabled(False) - # TODO: add settings for Qt 5.11+ self.jsClipboardCheckBox.setChecked( Preferences.getWebBrowser("JavaScriptCanAccessClipboard")) + try: + # Qt 5.11 + self.jsPasteCheckBox.setChecked( + Preferences.getWebBrowser("JavaScriptCanPaste")) + except KeyError: + self.jsPasteCheckBox.setEnabled(False) self.pluginsCheckBox.setChecked( Preferences.getWebBrowser("PluginsEnabled")) self.doNotTrackCheckBox.setChecked( @@ -245,6 +259,14 @@ "WebGLEnabled", self.webGLCheckBox.isChecked()) + if self.autoplayMediaCheckBox.isEnabled(): + Preferences.setWebBrowser( + "PlaybackRequiresUserGesture", + self.autoplayMediaCheckBox.isChecked()) + Preferences.setWebBrowser( + "WebRTCPublicInterfacesOnly", + self.webRtcPublicOnlyCheckBox.isChecked()) + Preferences.setWebBrowser( "JavaScriptEnabled", self.javaScriptGroup.isChecked()) @@ -258,6 +280,10 @@ Preferences.setWebBrowser( "JavaScriptCanAccessClipboard", self.jsClipboardCheckBox.isChecked()) + if self.jsPasteCheckBox.isEnabled(): + Preferences.setWebBrowser( + "JavaScriptCanPaste", + self.jsPasteCheckBox.isChecked()) Preferences.setWebBrowser( "PluginsEnabled", self.pluginsCheckBox.isChecked())
--- a/Preferences/ConfigurationPages/WebBrowserPage.ui Tue Jul 03 19:08:29 2018 +0200 +++ b/Preferences/ConfigurationPages/WebBrowserPage.ui Tue Jul 03 19:57:17 2018 +0200 @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>650</width> - <height>2000</height> + <height>2121</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_5"> @@ -127,6 +127,26 @@ </property> </widget> </item> + <item row="4" column="1"> + <widget class="QCheckBox" name="autoplayMediaCheckBox"> + <property name="toolTip"> + <string>Select, to inhibit playback of media content until the user interacts with the page</string> + </property> + <property name="text"> + <string>Don't auto-play media content</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QCheckBox" name="webRtcPublicOnlyCheckBox"> + <property name="toolTip"> + <string>Select to limit WebRTC to public IP addresses only</string> + </property> + <property name="text"> + <string>Only public IP-Addresses for WebRTC</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -417,6 +437,16 @@ </property> </widget> </item> + <item> + <widget class="QCheckBox" name="jsPasteCheckBox"> + <property name="toolTip"> + <string>Select to allow JavaScript to paste from the clipboard (this needs access to the clipboard)</string> + </property> + <property name="text"> + <string>Allow to paste from the clipboard</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -1086,6 +1116,8 @@ <tabstop>fullscreenCheckBox</tabstop> <tabstop>screenCaptureCheckBox</tabstop> <tabstop>webGLCheckBox</tabstop> + <tabstop>autoplayMediaCheckBox</tabstop> + <tabstop>webRtcPublicOnlyCheckBox</tabstop> <tabstop>startupCombo</tabstop> <tabstop>newTabCombo</tabstop> <tabstop>homePageEdit</tabstop> @@ -1099,6 +1131,7 @@ <tabstop>jsOpenWindowsCheckBox</tabstop> <tabstop>jsActivateWindowsCheckBox</tabstop> <tabstop>jsClipboardCheckBox</tabstop> + <tabstop>jsPasteCheckBox</tabstop> <tabstop>pluginsCheckBox</tabstop> <tabstop>doNotTrackCheckBox</tabstop> <tabstop>refererSendComboBox</tabstop>
--- a/Preferences/__init__.py Tue Jul 03 19:08:29 2018 +0200 +++ b/Preferences/__init__.py Tue Jul 03 19:57:17 2018 +0200 @@ -1297,7 +1297,7 @@ "PlaybackRequiresUserGesture": webEngineSettings.testAttribute( QWebEngineSettings.PlaybackRequiresUserGesture), - "JavascriptCanPaste": + "JavaScriptCanPaste": webEngineSettings.testAttribute( QWebEngineSettings.JavascriptCanPaste), "WebRTCPublicInterfacesOnly": @@ -3059,7 +3059,7 @@ "AllowGeolocationOnInsecureOrigins", "AllowWindowActivationFromJavaScript", "ShowScrollBars", "DownloadManagerAutoOpen", "DownloadManagerAutoClose", - "PlaybackRequiresUserGesture", "JavascriptCanPaste", + "PlaybackRequiresUserGesture", "JavaScriptCanPaste", "WebRTCPublicInterfacesOnly", ]: return toBool(prefClass.settings.value(
--- a/WebBrowser/CookieJar/CookieJar.py Tue Jul 03 19:08:29 2018 +0200 +++ b/WebBrowser/CookieJar/CookieJar.py Tue Jul 03 19:57:17 2018 +0200 @@ -21,6 +21,7 @@ import Preferences +# TODO: add code to support cookie filtering as of Qt 5.11 class CookieJar(QNetworkCookieJar): """ Class implementing a QNetworkCookieJar subclass with various accept
--- a/WebBrowser/StatusBar/JavaScriptSettingsDialog.py Tue Jul 03 19:08:29 2018 +0200 +++ b/WebBrowser/StatusBar/JavaScriptSettingsDialog.py Tue Jul 03 19:57:17 2018 +0200 @@ -45,9 +45,14 @@ "AllowWindowActivationFromJavaScript")) except KeyError: self.jsActivateWindowsCheckBox.setEnabled(False) - # TODO: add JavascriptCanPaste as of Qt 5.11+ self.jsClipboardCheckBox.setChecked( Preferences.getWebBrowser("JavaScriptCanAccessClipboard")) + try: + # Qt 5.11 + self.jsPasteCheckBox.setChecked( + Preferences.getWebBrowser("JavaScriptCanPaste")) + except KeyError: + self.jsPasteCheckBox.setEnabled(False) msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) @@ -67,10 +72,13 @@ Preferences.setWebBrowser( "AllowWindowActivationFromJavaScript", self.jsActivateWindowsCheckBox.isChecked()) - # TODO: add JavascriptCanPaste as of Qt 5.11+ Preferences.setWebBrowser( "JavaScriptCanAccessClipboard", self.jsClipboardCheckBox.isChecked()) + if self.jsPasteCheckBox.isEnabled(): + Preferences.setWebBrowser( + "JavaScriptCanPaste", + self.jsPasteCheckBox.isChecked()) Preferences.syncPreferences()
--- a/WebBrowser/StatusBar/JavaScriptSettingsDialog.ui Tue Jul 03 19:08:29 2018 +0200 +++ b/WebBrowser/StatusBar/JavaScriptSettingsDialog.ui Tue Jul 03 19:57:17 2018 +0200 @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>400</width> - <height>179</height> + <height>209</height> </rect> </property> <property name="windowTitle"> @@ -16,7 +16,7 @@ <property name="sizeGripEnabled"> <bool>true</bool> </property> - <layout class="QVBoxLayout" name="verticalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> <widget class="QGroupBox" name="javaScriptGroup"> <property name="toolTip"> @@ -28,7 +28,7 @@ <property name="checkable"> <bool>true</bool> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QCheckBox" name="jsOpenWindowsCheckBox"> <property name="toolTip"> @@ -59,6 +59,16 @@ </property> </widget> </item> + <item> + <widget class="QCheckBox" name="jsPasteCheckBox"> + <property name="toolTip"> + <string>Select to allow JavaScript to paste from the clipboard (this needs access to the clipboard)</string> + </property> + <property name="text"> + <string>Allow to paste from the clipboard</string> + </property> + </widget> + </item> </layout> </widget> </item>
--- a/WebBrowser/WebBrowserWindow.py Tue Jul 03 19:08:29 2018 +0200 +++ b/WebBrowser/WebBrowserWindow.py Tue Jul 03 19:57:17 2018 +0200 @@ -676,7 +676,7 @@ settings.setAttribute( QWebEngineSettings.JavascriptCanPaste, Preferences.getWebBrowser( - "JavascriptCanPaste")) + "JavaScriptCanPaste")) settings.setAttribute( QWebEngineSettings.WebRTCPublicInterfacesOnly, Preferences.getWebBrowser(
--- a/WebBrowser/WebInspector.py Tue Jul 03 19:08:29 2018 +0200 +++ b/WebBrowser/WebInspector.py Tue Jul 03 19:57:17 2018 +0200 @@ -26,6 +26,7 @@ _VIEWS = [] +# TODO: add support for web inspector variant of Qt 5.11 class WebInspector(QWebEngineView): """ Class implementing a QWebEngineView to load the web inspector in.