Allow extensions to read the value of the browser.privatebrowsing.autostart preference
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: jkt, Unassigned, Mentored)
Details
(Keywords: good-first-bug, Whiteboard: [design-decision-approved]triaged)
Comment 1•8 years ago
|
||
Reporter | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Reporter | ||
Comment 4•8 years ago
|
||
Updated•7 years ago
|
Comment 5•7 years ago
|
||
Reporter | ||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Updated•7 years ago
|
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Reporter | ||
Comment 10•7 years ago
|
||
Updated•7 years ago
|
Comment 11•7 years ago
|
||
Updated•6 years ago
|
Comment 12•6 years ago
|
||
Updated•6 years ago
|
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Updated•6 years ago
|
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Hey Tim! Just checking in again. :) If you've got something you'd like to have reviewed, you can go ahead and push it to Phabricator.
Comment 22•6 years ago
|
||
Hey Tim, I am going to open this bug up for other contributors to work on. If you'd like to, you can still submit a patch.
Comment 23•5 years ago
|
||
Hey Caitlin. I have patched a few bugs and am looking to move up from the 'good-first-bug' bugs. This bug looks interesting - although I don't have the faintest clue about how to solve it. The comments and descriptions above use a lot of jargon that I don't understand. Is this bug mentored to a level that is suitable for me?
Comment 24•5 years ago
|
||
(In reply to Rizwan Syed from comment #23)
Hey Caitlin. I have patched a few bugs and am looking to move up from the 'good-first-bug' bugs. This bug looks interesting - although I don't have the faintest clue about how to solve it. The comments and descriptions above use a lot of jargon that I don't understand. Is this bug mentored to a level that is suitable for me?
Hi Rizwan,
all the jargon used in the previous comments should become much more clear once you start to look into the kind of changes needed to fix this issue.
A good starting point is often taking a look to the existing code, e.g. starting from files or components mentioned in the above comments.
You can quickly look into what ext-browserSettings.js and ext-privacy.js do by searching for them on searchfox.org (searchfox is very helpful to quickly explore the Firefox sources):
- https://searchfox.org/mozilla-central/source/toolkit/components/extensions/parent/ext-privacy.js
- https://searchfox.org/mozilla-central/source/toolkit/components/extensions/parent/ext-browserSettings.js
To see how most of the settings ext-privacy.js are being exposed, you can take a look to the helper getPrivacyAPI
defined in ext-privacy.js itself, but for this setting we don't need set
or clear
(because the extensions shouldn't be able to control this preference) and so, as aswan mentioned in comment 14, this patch shouldn't need to use getPrivacyAPI
or ExtensionPreferenceManager
, but just the implementation for the single get()
method (which should just retrieve the current value of the preference and return it to the caller).
Once you have started to give a try to what kind of change needed by this bug, you may also start to have additional (and more specific) questions about these or new details, and so let me know if you need help by adding a needinfo assigned to me.
Comment 25•5 years ago
|
||
I'm not sure we should do this. The use case in comment 2 should be handled inside the API in question. It is the API implementation (ie. contextualIdentities) that should determine how it works in PPB, not the extension trying to assume it will work a certain way under different settings.
As well, I think an extension can already detect this by checking extension.inIncognitoContext in the background script, which would only ever be true in PPB (at least until/if we implement support for split mode).
Lets throw this back to mconca for now, and wait to do any work on it.
Comment 26•5 years ago
|
||
(In reply to Shane Caraveo (:mixedpuppy) from comment #25)
As well, I think an extension can already detect this by checking extension.inIncognitoContext in the background script, which would only ever be true in PPB (at least until/if we implement support for split mode).
Is this true? The extension.inIncognitoContext seems mostly (only?) useful for content scripts, and the value of that property in an extension background page isn't clearly defined when the extension is running as "incognito:spanning" (the default). This seems like a good MDN documentation opportunity.
Lets throw this back to mconca for now, and wait to do any work on it.
I'm also thinking we shouldn't do this. Adding an API to determine if Firefox is in permanent private browsing mode seems very limited, appealing only to extensions that want to do something different in perma-PBM versus when the user opens private windows individually. That's not really a practice I want to encourage, despite the fact that Mozilla's container extension seems to be doing this. I'd rather developers simply handle private and non-private windows appropriately within the extension.
Comment 27•5 years ago
|
||
(In reply to Mike Conca [:mconca] from comment #26)
(In reply to Shane Caraveo (:mixedpuppy) from comment #25)
As well, I think an extension can already detect this by checking extension.inIncognitoContext in the background script, which would only ever be true in PPB (at least until/if we implement support for split mode).
Is this true? The extension.inIncognitoContext seems mostly (only?) useful for content scripts, and the value of that property in an extension background page isn't clearly defined when the extension is running as "incognito:spanning" (the default). This seems like a good MDN documentation opportunity.
We have a test that verifies it can be used in teh background page, one that explicitly tests it is true for PPB.
It would be false when not in PPB, spanning or not.
If we do split mode, if there is a reason an extension needs to know that it is running in PPB, then we would probably benefit from adding this. But I don't see a particular reason to implement split mode (doesn't mean there isn't one).
Comment 28•5 years ago
|
||
Hey all, after seeing this discussion about doing this, I will leave it - until there is clear info on whether open source contributors should work on this bug.
Cheers
Comment 29•5 years ago
|
||
Rizwan, thank you! Stepping in and offering to work on this caused us to rethink it.
For now I'm going to close this bug and wontfix.
Description
•