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

Avoid retrying when the tab/frame doesn't exist #58

Open
fregante opened this issue Dec 19, 2021 · 1 comment
Open

Avoid retrying when the tab/frame doesn't exist #58

fregante opened this issue Dec 19, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@fregante
Copy link
Contributor

fregante commented Dec 19, 2021

If a tab/frame does not exist at all, it should not be retried, as it will never exist. This does not apply to named targets.

The problem is detecting the difference between a non-responsive tab and a non-existing one without also using tabs.get and/or browser.webNavigation.getAllFrames

Related:

@fregante fregante added the enhancement New feature or request label Dec 19, 2021
@fregante
Copy link
Contributor Author

This was actually partially implemented:

if (browser.tabs && typeof target.tabId === "number") {
try {
const tabInfo = await browser.tabs.get(target.tabId);
if (tabInfo.discarded) {
throw new Error(errorTabWasDiscarded);
}
} catch {
throw new Error(errorTabDoesntExist);
}
}

The only part missing is when the tab exists but the frame doesn't. Might still be very worth implementing

@fregante fregante changed the title Avoid retrying when not necessary Avoid retrying when the tab/frame doesn't exist Jan 21, 2024
@fregante fregante self-assigned this Feb 9, 2024
@fregante fregante removed their assignment Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant