WebExtension.allowedInPrivateBrowsing is not persisted after the app process gets killed.
Categories
(GeckoView :: Extensions, defect, P1)
Tracking
(firefox78 fixed)
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: schae, Assigned: agi)
Details
(Whiteboard: [geckoview:m78])
Attachments
(3 files, 1 obsolete file)
Related fenix issue: https://github.com/mozilla-mobile/fenix/issues/10290
STR:
- Set
WebExtension.allowedInPrivateBrowsing
to true (false by default) - Close the app & restart
It appears that if WebExtension.enabled state
is changed with allowedInPrivateBrowsing
, then the allowedInPrivateBrowsing
is persisted.
Assignee | ||
Comment 1•4 years ago
|
||
When exporting the addon object, the extension policy sometimes is not ready
yet (very common when list()
is called at startup), so we need to wait until
it's ready or the values in it will not be correct.
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
When exporting the addon object, the extension policy sometimes is not ready
yet (very common when list()
is called at startup), so we need to wait until
it's ready or the values in it will not be correct.
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/65e4e70c6851 Wait for extension policy to be ready. r=aklotz https://hg.mozilla.org/integration/autoland/rev/4d31941a0eb4 Add GVE setting for extensions in private browsing. r=aklotz
Assignee | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/65e4e70c6851
https://hg.mozilla.org/mozilla-central/rev/4d31941a0eb4
Assignee | ||
Updated•4 years ago
|
Reporter | ||
Comment 6•4 years ago
|
||
I'm seeing this bug intermittently now. Here's a reproducible workflow:
- Set ublock allowPrivateBrowsing to false (from true) and confirm success callback
- Restart app and check metadata for ublock when
runtime.webExtensionController.list()
- confirm false - Set ublock allowPrivateBrowsing to true (from false) and confirm success callback
- Restart app and check metadata for ublock when
runtime.webExtensionController.list()
- still false
2020-05-08 12:14:38.096 14135-14135/org.mozilla.samples.browser D/allowPrivateBrowsing: success: false
2020-05-08 12:14:47.810 14594-14594/org.mozilla.samples.browser D/allowPrivateBrowsing: listInstalledWebExtensions: uBlock0@raymondhill.net/false
2020-05-08 12:14:54.268 14594-14594/org.mozilla.samples.browser D/allowPrivateBrowsing: success: true
2020-05-08 12:15:02.545 14858-14858/org.mozilla.samples.browser D/allowPrivateBrowsing: listInstalledWebExtensions: uBlock0@raymondhill.net/false
Assignee | ||
Comment 7•4 years ago
|
||
WebExtensionPolicy.getByID(id) will return a stub when called earlier during
startup. Once the startup process is complete, this object is sawpped with the
real extension policy.
Before this patch, we used to hold onto the stub object, which makes it so that
we read incorrect values even though we are waiting for the policy to be ready.
To fix this we just read the result value of the readyPromise promise.
Assignee | ||
Comment 8•4 years ago
|
||
Thanks Simon! There was a bug on our side, next nightly should have the fix :)
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e1d0588ee5c5 Re-read the policy object when exporting extensions. r=snorp
Comment 10•4 years ago
|
||
bugherder |
Reporter | ||
Comment 11•4 years ago
|
||
I'm still seeing intermittent issue with nightly version (78.0.20200510092917):
log with id is from runtime.webExtensionController.list()
and just the boolean value is from runtime.webExtensionController.setAllowedInPrivateBrowsing()
success callback
2020-05-11 09:53:41.878 5759-5759/org.mozilla.samples.browser D/++private-browsing++: false
2020-05-11 09:53:43.242 5759-5759/org.mozilla.samples.browser D/++private-browsing++: true
2020-05-11 09:53:53.963 6817-6817/org.mozilla.samples.browser D/++private-browsing++: id: uBlock0@raymondhill.net / true
2020-05-11 09:54:03.541 6817-6817/org.mozilla.samples.browser D/++private-browsing++: false
2020-05-11 09:54:16.406 7137-7137/org.mozilla.samples.browser D/++private-browsing++: id: uBlock0@raymondhill.net / true
2020-05-11 09:54:25.290 7137-7137/org.mozilla.samples.browser D/++private-browsing++: false
2020-05-11 09:54:36.985 7401-7401/org.mozilla.samples.browser D/++private-browsing++: id: uBlock0@raymondhill.net / false
2020-05-11 09:54:43.557 7401-7401/org.mozilla.samples.browser D/++private-browsing++: true
2020-05-11 09:54:54.302 7714-7714/org.mozilla.samples.browser D/++private-browsing++: id: uBlock0@raymondhill.net / true
2020-05-11 09:55:05.207 7714-7714/org.mozilla.samples.browser D/++private-browsing++: false
2020-05-11 09:55:14.388 7983-7983/org.mozilla.samples.browser D/++private-browsing++: id: uBlock0@raymondhill.net / false
2020-05-11 09:55:20.700 7983-7983/org.mozilla.samples.browser D/++private-browsing++: true
2020-05-11 09:55:28.649 8265-8265/org.mozilla.samples.browser D/++private-browsing++: id: uBlock0@raymondhill.net / false```
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Comment 12•4 years ago
|
||
Simon: do you kill the app quickly after setting the value? The value has to be written to disk so it takes a little bit to persist. We could potentially change this behavior but I think it would be a separate bug.
Reporter | ||
Comment 13•4 years ago
|
||
(In reply to Agi Sferro | :agi | ⏰ PST | he/him from comment #12)
Simon: do you kill the app quickly after setting the value? The value has to be written to disk so it takes a little bit to persist. We could potentially change this behavior but I think it would be a separate bug.
Hmm, how quickly is too quickly? I kill the app after runtime.webExtensionController.setAllowedInPrivateBrowsing()
success callback (https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-gecko-nightly/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt#L437).
Assignee | ||
Comment 14•4 years ago
|
||
About a few seconds, can you still reproduce if you wait like 10 seconds before restarting the app?
Reporter | ||
Comment 15•4 years ago
|
||
It does appear to be more consistent if I wait x amount of time before restarting the app. Enable/disable works with minimal wait time, is there a difference between how these two values are written to the disk?
Assignee | ||
Comment 16•4 years ago
|
||
Yeah we do have different code paths and some flush earlier than others, I'm addressing that in Bug 1637680, please follow that bug. I'm gonna resolve this in the meanwhile since the problem outlined in this bug is fixed.
Description
•