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

Documentation on runtime.connect does not address manifest V3 background scripts dropping ports when they drop off after inactivity #36097

Open
TruBlu2U opened this issue Sep 29, 2024 · 2 comments
Labels
Content:WebExt WebExtensions docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@TruBlu2U
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/connect

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

When trying to create a V3 browser extension, I am finding that the extension background page is unloaded (as expected) after a period of inactivity. This creates a Port.onDisconnect event in the content script from which the connection was initiated, but often results in the inability to successfully open a new port to the background script if inactivity is about 20 seconds or more.

What did you expect to see?

I expected to see some direction regarding how to successfully and reliably reconnect to the background script after it gets unloaded.

Do you have any supporting links, references, or citations?

Extension Testing.txt

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@TruBlu2U TruBlu2U added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Sep 29, 2024
@github-actions github-actions bot added the Content:WebExt WebExtensions docs label Sep 29, 2024
@TruBlu2U
Copy link
Author

By the way, I am using the Firefox Browser Console tool to capture the log console log entries, so as to prevent the presence of the extension Inspect tool from throwing warning messages indicating that hooks from the Inspect tool were preventing the background script from being unloaded.

@TruBlu2U
Copy link
Author

Also, the background script is being loaded from a background.html file specified in the manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebExt WebExtensions docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant