geolocation permission doesn't work when pref permissions.default.geo is non-zero
Categories
(WebExtensions :: General, defect, P3)
Tracking
(Not tracked)
People
(Reporter: robwu, Assigned: robwu, NeedInfo)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 file)
I was looking into integrating the "notifications" permission in the permission manager (bug 1589693), and looked at our existing "geolocation" permission, since it has similar characteristics.
Upon reviewing the relevant code, it is obvious that the implementation has a flaw. It seems that the intention is to only add the permission if the user did not explicitly set it (e.g. to deny) (testPermission("geo") === Services.perms.UNKNOWN_ACTION
).
However, when the permissions.default.geo
preference is set, then that value is returned instead of UNKNOWN_ACTION
, and the logic falls apart (i.e. permission is not added).
In order to fix this, we need to either be able to read the permission (ignoring the default pref branch), or be able to add a preference that overrides the default, but can be overridden by the user's explicit choice. The advantage of a system like the latter is that when the user resets the pref's value, that the extension permission is used as a fallback instead of the browser's default (which would happen anyway when the extension or browser is restarted).
Comment 1•5 years ago
|
||
I would recommend just skipping the default pref check for WebExtension principals. That seems easiest to me, if I'm not missing something.
Assignee | ||
Comment 2•5 years ago
|
||
I'm working on a patch where I change testPermission
's implementation by replacing Services.perms.testPermissionFromPrincipal
with Services.perms.getPermissionObject
. This will achieve the desired effect, while the usual permission management logic is still consistent with regular http(s) web pages.
Assignee | ||
Comment 3•5 years ago
|
||
Comment 4•5 years ago
|
||
The priority flag is not set for this bug.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•5 years ago
|
Comment 5•5 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:robwu, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•2 years ago
|
Description
•