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:
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"
yes_action: A callable to call if the request was approved
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):
"""Ask the user for approval for geolocation/media/etc.."""
options = {
QWebEnginePage.Geolocation: ('content', 'geolocation'),
QWebEnginePage.MediaAudioCapture: ('content', 'media-capture'),
QWebEnginePage.MediaVideoCapture: ('content', 'media-capture'),
QWebEnginePage.MediaAudioVideoCapture:
('content', 'media-capture'),
QWebEnginePage.Geolocation: 'content.geolocation',
QWebEnginePage.MediaAudioCapture: 'content.media_capture',
QWebEnginePage.MediaVideoCapture: 'content.media_capture',
QWebEnginePage.MediaAudioVideoCapture: 'content.media_capture',
}
messages = {
QWebEnginePage.Geolocation: 'access your location',

View File

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