Skip to content
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: tabs.Tab should include the documentId. #495

Closed
newRoland opened this issue Nov 23, 2023 · 5 comments
Closed

Proposal: tabs.Tab should include the documentId. #495

newRoland opened this issue Nov 23, 2023 · 5 comments
Labels
proposal Proposal for a change or new feature supportive: safari Supportive from Safari

Comments

@newRoland
Copy link

newRoland commented Nov 23, 2023

Context

The documentId has use cases throughout the WebExtensions APIs, and more is to come. However, the only ways to retrieve it seems to be by pinging a content script or using the WebNavigation permission (getFrame, onCommitted).

The WebNavigation permission has a permissions warning that many extension publishers will like to avoid. It's also safer for the user if the extension doesn't need it. The developer might also not have a content script available for pinging.

Proposal

The Tab object already includes information on the tab's main frame like URL, pendingURL, favicon, etc. I propose also including the documentId and pendingDocumentId. That way it can be retrieved through tabs.get or tabs.query.

@newRoland newRoland changed the title Proposal: tabs.query, tabs.get should include the documentId. Proposal: tabs.Tab object should include documentId. Nov 23, 2023
@newRoland newRoland changed the title Proposal: tabs.Tab object should include documentId. Proposal: tabs.Tab should include the documentId. Nov 23, 2023
@xeenon xeenon added supportive: safari Supportive from Safari proposal Proposal for a change or new feature and removed needs-triage labels Nov 24, 2023
@newRoland
Copy link
Author

Turns out you can also retrieve the documentId from pinging a content script and getting a reply. OnMessage sender includes documentId. The proposal is still useful, but it's no longer necessary for me.

@newRoland newRoland closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2023
@fregante
Copy link

This would still be useful and make a lot of sense. Having to ping the content script means you also need the scripting permission, whereas accessing this documentId probably wouldn't even need tabs

@newRoland
Copy link
Author

I can't think about specific examples it would be needed. It's worth it for the convenience alone, but I don't think they will implement the proposal without a stronger justification.

@fregante
Copy link

If you reopen they will decide. If not I'll reopen the issue myself

@newRoland
Copy link
Author

A better proposal might be to alias getFrame, and getAllFrames, so it's accessible from both webNavigation and tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for a change or new feature supportive: safari Supportive from Safari
Projects
None yet
Development

No branches or pull requests

3 participants