Skip to content

Proposal: documentId in tabs.query() filter #586

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bershanskiy
Copy link
Member

@bershanskiy bershanskiy commented Apr 8, 2024

Copy link
Collaborator

@rdcronin rdcronin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Very belated) thank you for the PR! There's a few extra pieces here we should polish out, but I am generally supportive of this change.

Comment on lines +3 to +9
** How to Use This Template **

See [Proposal Process](proposal_process.md) for the detailed process on how to
propose new APIs and use this template. Each section includes instructions on
what to include. Delete the instructions for a given section once it's filled
out. Remove this section once the template is filled out.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this section, per instructions

Suggested change
** How to Use This Template **
See [Proposal Process](proposal_process.md) for the detailed process on how to
propose new APIs and use this template. Each section includes instructions on
what to include. Delete the instructions for a given section once it's filled
out. Remove this section once the template is filled out.

time-of-check-time-of-use bugs. Currently extension may query tabs based on
only incidental identifiers like `windowId`, `index`, and if extension has
powerful `"tabs"` permission, then also `title` and `url`. Such checks are
inherintly cumbersome for the extension developer, may lead to extension
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inherintly cumbersome for the extension developer, may lead to extension
inherently cumbersome for the extension developer, may lead to extension

browsing session.
3. If `documentId` is provided and valid, then `tabs.query()` returns only the
tab which hosts the corresponding document in a top-level context and
matching all other filters. (In particular, if `documentId` corresponds to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this (the subframe behavior). It seems like being able to query which tab holds a document could be useful, independent of if it's a main frame or subframe (e.g., for querying which tab holds a particular frame that the extension may have injected into via a scripting API).

Curious for other folks' thoughts on this. Should we limit this to top frames?

tab which hosts the corresponding document in a top-level context and
matching all other filters. (In particular, if `documentId` corresponds to
sub-frame, an empty list is returned, matching current implementation.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to specify the behavior for other unusual cases, such as:

  • prerendered documents
  • cached (bfcache) documents
  • documents in a (web) popup
  • documents in an (extension) popup
    etc

### Exposed Sensitive Data

Document ids correspond to unique page loads, so a compromised or malicious
extension could infer page navigations by polling `tabs.query()` untill a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
extension could infer page navigations by polling `tabs.query()` untill a
extension could infer page navigations by polling `tabs.query()` until a


Document ids correspond to unique page loads, so a compromised or malicious
extension could infer page navigations by polling `tabs.query()` untill a
particular document appears or disappers to conclude back-forth navigation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
particular document appears or disappers to conclude back-forth navigation.
particular document appears or disappears to conclude back-forth navigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants