Adjust feature permissions

This commit is contained in:
Florian Bruhin 2017-06-13 16:18:50 +02:00
parent e828f5b812
commit 45ce7efc71
3 changed files with 7 additions and 8 deletions

View File

@ -171,7 +171,7 @@ def feature_permission(url, option, msg, yes_action, no_action, abort_on):
Args: Args:
url: The URL the request was done for. url: The URL the request was done for.
option: A (section, option) tuple for the option to check. option: An option name to check.
msg: A string like "show notifications" msg: A string like "show notifications"
yes_action: A callable to call if the request was approved yes_action: A callable to call if the request was approved
no_action: A callable to call if the request was denied no_action: A callable to call if the request was denied

View File

@ -148,11 +148,10 @@ class WebEnginePage(QWebEnginePage):
def _on_feature_permission_requested(self, url, feature): def _on_feature_permission_requested(self, url, feature):
"""Ask the user for approval for geolocation/media/etc..""" """Ask the user for approval for geolocation/media/etc.."""
options = { options = {
QWebEnginePage.Geolocation: ('content', 'geolocation'), QWebEnginePage.Geolocation: 'content.geolocation',
QWebEnginePage.MediaAudioCapture: ('content', 'media-capture'), QWebEnginePage.MediaAudioCapture: 'content.media_capture',
QWebEnginePage.MediaVideoCapture: ('content', 'media-capture'), QWebEnginePage.MediaVideoCapture: 'content.media_capture',
QWebEnginePage.MediaAudioVideoCapture: QWebEnginePage.MediaAudioVideoCapture: 'content.media_capture',
('content', 'media-capture'),
} }
messages = { messages = {
QWebEnginePage.Geolocation: 'access your location', QWebEnginePage.Geolocation: 'access your location',

View File

@ -304,8 +304,8 @@ class BrowserPage(QWebPage):
return return
options = { options = {
QWebPage.Notifications: ('content', 'notifications'), QWebPage.Notifications: 'content.notifications',
QWebPage.Geolocation: ('content', 'geolocation'), QWebPage.Geolocation: 'content.geolocation',
} }
messages = { messages = {
QWebPage.Notifications: 'show notifications', QWebPage.Notifications: 'show notifications',