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: Include documentId in Tab object #496

Open
fregante opened this issue Nov 24, 2023 · 1 comment
Open

Proposal: Include documentId in Tab object #496

fregante opened this issue Nov 24, 2023 · 1 comment
Labels
proposal Proposal for a change or new feature supportive: safari Supportive from Safari

Comments

@fregante
Copy link

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.

Originally posted by @newRoland in #495

@fregante
Copy link
Author

fregante commented Nov 24, 2023

I'll add: having the documentId readily available when querying tabs can help ensure that follow-up actions are towards a specific document only, like executeScript or sendMessage.

Also, I assume that this piece of information, like tabId and frameId, can be made available without any specific permissions.

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

2 participants