Remove MouseLock permission support

For some reason it doesn't work...
This commit is contained in:
Florian Bruhin 2016-11-10 21:00:03 +01:00
parent bbcbb24cb5
commit adb2ce0160
3 changed files with 9 additions and 21 deletions

View File

@ -161,7 +161,6 @@
|<<content-geolocation,geolocation>>|Allow websites to request geolocations. |<<content-geolocation,geolocation>>|Allow websites to request geolocations.
|<<content-notifications,notifications>>|Allow websites to show notifications. |<<content-notifications,notifications>>|Allow websites to show notifications.
|<<content-media-capture,media-capture>>|Allow websites to record audio/video. |<<content-media-capture,media-capture>>|Allow websites to record audio/video.
|<<content-mouse-lock,mouse-lock>>|Allow websites to lock the mouse pointer.
|<<content-javascript-can-open-windows-automatically,javascript-can-open-windows-automatically>>|Whether JavaScript programs can open new windows without user interaction. |<<content-javascript-can-open-windows-automatically,javascript-can-open-windows-automatically>>|Whether JavaScript programs can open new windows without user interaction.
|<<content-javascript-can-close-windows,javascript-can-close-windows>>|Whether JavaScript programs can close windows. |<<content-javascript-can-close-windows,javascript-can-close-windows>>|Whether JavaScript programs can close windows.
|<<content-javascript-can-access-clipboard,javascript-can-access-clipboard>>|Whether JavaScript programs can read or write to the clipboard. |<<content-javascript-can-access-clipboard,javascript-can-access-clipboard>>|Whether JavaScript programs can read or write to the clipboard.
@ -1466,20 +1465,6 @@ Default: +pass:[ask]+
This setting is only available with the QtWebEngine backend. This setting is only available with the QtWebEngine backend.
[[content-mouse-lock]]
=== mouse-lock
Allow websites to lock the mouse pointer.
Valid values:
* +true+
* +false+
* +ask+
Default: +pass:[ask]+
This setting is only available with the QtWebEngine backend.
[[content-javascript-can-open-windows-automatically]] [[content-javascript-can-open-windows-automatically]]
=== javascript-can-open-windows-automatically === javascript-can-open-windows-automatically
Whether JavaScript programs can open new windows without user interaction. Whether JavaScript programs can open new windows without user interaction.

View File

@ -133,7 +133,6 @@ class WebEnginePage(QWebEnginePage):
QWebEnginePage.MediaAudioCapture: ('content', 'media-capture'), QWebEnginePage.MediaAudioCapture: ('content', 'media-capture'),
QWebEnginePage.MediaVideoCapture: ('content', 'media-capture'), QWebEnginePage.MediaVideoCapture: ('content', 'media-capture'),
QWebEnginePage.MediaAudioVideoCapture: ('content', 'media-capture'), QWebEnginePage.MediaAudioVideoCapture: ('content', 'media-capture'),
QWebEnginePage.MouseLock: ('content', 'mouse-lock'),
} }
messages = { messages = {
QWebEnginePage.Geolocation: 'access your location', QWebEnginePage.Geolocation: 'access your location',
@ -141,6 +140,15 @@ class WebEnginePage(QWebEnginePage):
QWebEnginePage.MediaVideoCapture: 'record video', QWebEnginePage.MediaVideoCapture: 'record video',
QWebEnginePage.MediaAudioVideoCapture: 'record audio/video', QWebEnginePage.MediaAudioVideoCapture: 'record audio/video',
} }
assert options.keys() == messages.keys()
if feature not in options:
log.webview.error("Unhandled feature permission {}".format(
debug.qenum_key(QWebEnginePage, feature)))
self.setFeaturePermission(url, feature,
QWebEnginePage.PermissionDeniedByUser)
return
yes_action = functools.partial( yes_action = functools.partial(
self.setFeaturePermission, url, feature, self.setFeaturePermission, url, feature,
QWebEnginePage.PermissionGrantedByUser) QWebEnginePage.PermissionGrantedByUser)

View File

@ -826,11 +826,6 @@ def data(readonly=False):
backends=[usertypes.Backend.QtWebEngine]), backends=[usertypes.Backend.QtWebEngine]),
"Allow websites to record audio/video."), "Allow websites to record audio/video."),
('mouse-lock',
SettingValue(typ.BoolAsk(), 'ask',
backends=[usertypes.Backend.QtWebEngine]),
"Allow websites to lock the mouse pointer."),
('javascript-can-open-windows-automatically', ('javascript-can-open-windows-automatically',
SettingValue(typ.Bool(), 'false'), SettingValue(typ.Bool(), 'false'),
"Whether JavaScript programs can open new windows without user " "Whether JavaScript programs can open new windows without user "