|
@@ -37,9 +37,14 @@ export function attachDebugger(tabId, prevTab) {
|
|
|
|
|
|
export function waitTabLoaded(tabId, ms = 10000) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- let timeout = null;
|
|
|
+ const excludeErrors = ['net::ERR_BLOCKED_BY_CLIENT', 'net::ERR_ABORTED'];
|
|
|
+
|
|
|
const onErrorOccurred = (details) => {
|
|
|
- if (details.tabId !== tabId || details.error.includes('ERR_ABORTED'))
|
|
|
+ if (
|
|
|
+ details.tabId !== tabId ||
|
|
|
+ details.frameId !== 0 ||
|
|
|
+ !excludeErrors.includes(details.error)
|
|
|
+ )
|
|
|
return;
|
|
|
|
|
|
browser.webNavigation.onErrorOccurred.removeListener(onErrorOccurred);
|