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

add no tab with ID error as OK error for postMessageToPortIfConnected #1230

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions app/ts/background/messageSending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ function postMessageToPortIfConnected(port: browser.runtime.Port, message: Inter
port.postMessage(serialize(InterceptorMessageToInpage, message) as Object)
} catch (error) {
if (error instanceof Error) {
if (error.message?.includes('Attempting to use a disconnected port object')) {
return
}
if (error.message?.includes('Could not establish connection. Receiving end does not exist')) {
return
}
if (error.message?.includes('Attempting to use a disconnected port object')) return
if (error.message?.includes('Could not establish connection. Receiving end does not exist')) return
if (error.message?.includes('No tab with id')) return
}
throw error
}
Expand Down
Loading