QtWebEngine: Restore Qt 5.6 compatibility
This commit is contained in:
parent
029ea2e5a7
commit
94cf3fa4ff
@ -149,7 +149,7 @@
|
|||||||
|<<content-allow-images,allow-images>>|Whether images are automatically loaded in web pages.
|
|<<content-allow-images,allow-images>>|Whether images are automatically loaded in web pages.
|
||||||
|<<content-allow-javascript,allow-javascript>>|Enables or disables the running of JavaScript programs.
|
|<<content-allow-javascript,allow-javascript>>|Enables or disables the running of JavaScript programs.
|
||||||
|<<content-allow-plugins,allow-plugins>>|Enables or disables plugins in Web pages.
|
|<<content-allow-plugins,allow-plugins>>|Enables or disables plugins in Web pages.
|
||||||
|<<content-webgl,webgl>>|Enables or disables WebGL.
|
|<<content-webgl,webgl>>|Enables or disables WebGL. For QtWebEngine, Qt/PyQt >= 5.7 is required for this setting.
|
||||||
|<<content-css-regions,css-regions>>|Enable or disable support for CSS regions.
|
|<<content-css-regions,css-regions>>|Enable or disable support for CSS regions.
|
||||||
|<<content-hyperlink-auditing,hyperlink-auditing>>|Enable or disable hyperlink auditing (<a ping>).
|
|<<content-hyperlink-auditing,hyperlink-auditing>>|Enable or disable hyperlink auditing (<a ping>).
|
||||||
|<<content-geolocation,geolocation>>|Allow websites to request geolocations.
|
|<<content-geolocation,geolocation>>|Allow websites to request geolocations.
|
||||||
@ -1377,7 +1377,7 @@ Default: +pass:[false]+
|
|||||||
|
|
||||||
[[content-webgl]]
|
[[content-webgl]]
|
||||||
=== webgl
|
=== webgl
|
||||||
Enables or disables WebGL.
|
Enables or disables WebGL. For QtWebEngine, Qt/PyQt >= 5.7 is required for this setting.
|
||||||
|
|
||||||
Valid values:
|
Valid values:
|
||||||
|
|
||||||
|
@ -110,8 +110,6 @@ MAPPINGS = {
|
|||||||
Attribute(QWebEngineSettings.JavascriptCanAccessClipboard),
|
Attribute(QWebEngineSettings.JavascriptCanAccessClipboard),
|
||||||
'allow-plugins':
|
'allow-plugins':
|
||||||
Attribute(QWebEngineSettings.PluginsEnabled),
|
Attribute(QWebEngineSettings.PluginsEnabled),
|
||||||
'webgl':
|
|
||||||
Attribute(QWebEngineSettings.WebGLEnabled),
|
|
||||||
'hyperlink-auditing':
|
'hyperlink-auditing':
|
||||||
Attribute(QWebEngineSettings.HyperlinkAuditingEnabled),
|
Attribute(QWebEngineSettings.HyperlinkAuditingEnabled),
|
||||||
'local-content-can-access-remote-urls':
|
'local-content-can-access-remote-urls':
|
||||||
@ -183,3 +181,9 @@ MAPPINGS = {
|
|||||||
setter=QWebEngineSettings.setDefaultTextEncoding),
|
setter=QWebEngineSettings.setDefaultTextEncoding),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
MAPPINGS['content']['webgl'] = Attribute(QWebEngineSettings.WebGLEnabled)
|
||||||
|
except AttributeError:
|
||||||
|
# Added in Qt 5.7
|
||||||
|
pass
|
||||||
|
@ -348,10 +348,17 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
|
|
||||||
def run_js_async(self, code, callback=None):
|
def run_js_async(self, code, callback=None):
|
||||||
world = QWebEngineScript.ApplicationWorld
|
world = QWebEngineScript.ApplicationWorld
|
||||||
if callback is None:
|
try:
|
||||||
self._widget.page().runJavaScript(code, world)
|
if callback is None:
|
||||||
else:
|
self._widget.page().runJavaScript(code, world)
|
||||||
self._widget.page().runJavaScript(code, world, callback)
|
else:
|
||||||
|
self._widget.page().runJavaScript(code, world, callback)
|
||||||
|
except TypeError:
|
||||||
|
# Qt < 5.7
|
||||||
|
if callback is None:
|
||||||
|
self._widget.page().runJavaScript(code)
|
||||||
|
else:
|
||||||
|
self._widget.page().runJavaScript(code, callback)
|
||||||
|
|
||||||
def run_js_blocking(self, code):
|
def run_js_blocking(self, code):
|
||||||
unset = object()
|
unset = object()
|
||||||
|
@ -775,7 +775,8 @@ def data(readonly=False):
|
|||||||
|
|
||||||
('webgl',
|
('webgl',
|
||||||
SettingValue(typ.Bool(), 'false'),
|
SettingValue(typ.Bool(), 'false'),
|
||||||
"Enables or disables WebGL."),
|
"Enables or disables WebGL. For QtWebEngine, Qt/PyQt >= 5.7 is "
|
||||||
|
"required for this setting."),
|
||||||
|
|
||||||
('css-regions',
|
('css-regions',
|
||||||
SettingValue(typ.Bool(), 'true',
|
SettingValue(typ.Bool(), 'true',
|
||||||
|
Loading…
Reference in New Issue
Block a user