Skip to content

Proposal: runtime.onInvalidated event #792

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 13 commits into
base: main
Choose a base branch
from

Conversation

carlosjeurissen
Copy link
Contributor

Proposal for #138 and #789

It introduces a new event which fires in contentScripts and extension frames when the background scripts get invalidated. In the event is a reason property stating the reason for the invalidation.

@bershanskiy @fregante love to hear your feedback.

@carlosjeurissen carlosjeurissen force-pushed the proposal/runtime-onInvalidated branch from 94dca27 to bbfe5ee Compare March 26, 2025 15:06
Copy link
Member

@oliverdunk oliverdunk left a comment

Choose a reason for hiding this comment

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

Thanks Carlos! Left some initial comments.

@carlosjeurissen carlosjeurissen force-pushed the proposal/runtime-onInvalidated branch 3 times, most recently from 7e295ab to 57258f4 Compare March 26, 2025 15:23
@oliverdunk oliverdunk requested a review from rdcronin March 26, 2025 15:39
Copy link
Member

@oliverdunk oliverdunk left a comment

Choose a reason for hiding this comment

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

LGTM (with nit around optional field), adding Devlin to review as well.

@carlosjeurissen carlosjeurissen force-pushed the proposal/runtime-onInvalidated branch from 57258f4 to dff9ba7 Compare March 26, 2025 15:43
@carlosjeurissen carlosjeurissen requested a review from Rob--W March 26, 2025 20:29
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.

Thank you, Carlos! Just a few small comments on this one, otherwise, LGTM

@carlosjeurissen carlosjeurissen changed the title Proposal: runtime.onInvalidated event Proposal: runtime.onInvalidated event Mar 27, 2025

### Objective

This event allows extension contexts which stay alive to be notified when the
Copy link
Member

Choose a reason for hiding this comment

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

"extension context" is very generic, while this seems to primarily be targeting content scripts. Can we restrict this to content scripts?

Copy link
Contributor Author

@carlosjeurissen carlosjeurissen Mar 31, 2025

Choose a reason for hiding this comment

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

@Rob--W it is generic on purpose as to cover both content scripts and iframed extension contexts on third party websites. These iframes stay alive on some browsers and require this event to handle their state. The objective states contexts which stay alive to exclude extension contexts which get killed on invalidation.

Updated the objective to be more explicit on this behaviour.

@fregante
Copy link

What are the next steps for this PR? Seems to be approved but not merged?

@carlosjeurissen
Copy link
Contributor Author

@Rob--W can you do a final review / give approval for this proposal?

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.

6 participants