-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal inconsistency: runtime.getContexts() proposal differs from Chromium implementation #498
Comments
@oliverdunk Any thoughts on this one? We are actively working on the implementation in Firefox, at https://bugzilla.mozilla.org/show_bug.cgi?id=1875480 I'm especially wondering about why options_ui is missing from getContexts, since it is present in getViews(). And what is the expected contextType for options_ui? It is not really a tab, so maybe a new context type may make sense here, e.g. "OPTIONS_TAB" (open to other names). |
I spoke to @rdcronin about each of the questions here.
We couldn't find this noted anywhere, but made this mandatory because we believed it was the preference from Mozilla's side. If @Rob--W is happy to make it optional, we would be open to that.
I've opened a PR to fix this here: #650. It is a non-goal to keep the proposals up to date with future changes, but this seemed like an easy enough fix.
I didn't get a chance to chat to Devlin about this one, but I think that makes sense, at least in Chromium where they close on tab changes. Curious for what other browser vendors think.
In Chromium, they are always tied to a window, so we should fix https://bugs.chromium.org/p/chromium/issues/detail?id=1468914 and return a window ID. For the tab ID, our preference would be only including that for tab-specific side panels.
We do think we should start including them. Our preference would be to simply use the |
The idea behind requiring an option is to encourage extension developers to think about the filter they are using, so that they would use a very specific filter to avoid returning too many, if the API ever returns more.
We set the windowId but not the tabId because the popup is anchored to a window, not a tab. Open to consider non-
In Firefox we use "TAB" for contexts in embedded options pages. |
The proposal document New API: runtime.getContexts() was merged before the first implementation arrived in Chromium. The final implemented API differs from the proposal a little bit. Is there any interest in updating the proposal (for future API implementors and API consumers)?
The differences (non-exhaustive list):
ContextFilter
argument inruntime.getContexts()
is optional (and omitting it is equivalent to passing an empty object{}
) while in reality the argument is mandatory (docs, discussion).extension.ContextType.SIDE_PANEL
does not have a declared value (it should be justSIDE_PANEL
, obviously)The under-specified behaviors (non-exhaustive list):
Chromium issue 1468914: Extension API: wrong windowsId data in chrome.runtime.getContexts() for side panel objects
getContexts()
? Currently, Chromium does not report them.The text was updated successfully, but these errors were encountered: