mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Improve internal error reporting in troubleshooting info
This commit is contained in:
parent
d54c4a7052
commit
25d9964b1e
5 changed files with 15 additions and 15 deletions
|
|
@ -191,7 +191,7 @@ function onMessage(request, sender, callback) {
|
|||
origin: 'USER',
|
||||
target: { tabId, frameIds: [ frameId ] },
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`insertCSS/${reason}`);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
|
@ -203,7 +203,7 @@ function onMessage(request, sender, callback) {
|
|||
origin: 'USER',
|
||||
target: { tabId, frameIds: [ frameId ] },
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`removeCSS/${reason}`);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
|
@ -242,7 +242,7 @@ function onMessage(request, sender, callback) {
|
|||
target: { tabId, frameIds: [ frameId ] },
|
||||
injectImmediately: true,
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`executeScript/${reason}`);
|
||||
}).then(( ) => {
|
||||
callback();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function fetchJSON(path) {
|
|||
return fetch(`${path}.json`).then(response =>
|
||||
response.json()
|
||||
).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`fetchJSON/${reason}`);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ export function startCustomFilters(tabId, frameId) {
|
|||
target: { tabId, frameIds: [ frameId ] },
|
||||
injectImmediately: true,
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`startCustomFilters/${reason}`);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ export function terminateCustomFilters(tabId, frameId) {
|
|||
target: { tabId, frameIds: [ frameId ] },
|
||||
injectImmediately: true,
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`terminateCustomFilters/${reason}`);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ export async function injectCustomFilters(tabId, frameId, hostname) {
|
|||
origin: 'USER',
|
||||
target: { tabId, frameIds: [ frameId ] },
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`injectCustomFilters/insertCSS/${reason}`);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ export async function injectCustomFilters(tabId, frameId, hostname) {
|
|||
target: { tabId, frameIds: [ frameId ] },
|
||||
injectImmediately: true,
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`injectCustomFilters/executeScript/${reason}`);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ async function updateDynamicRules() {
|
|||
ubolLog(`Add ${addRules.length} dynamic DNR rules`);
|
||||
}
|
||||
} catch(reason) {
|
||||
ubolErr(`updateDynamicRules() / ${reason}`);
|
||||
ubolErr(`updateDynamicRules/${reason}`);
|
||||
response.error = `${reason}`;
|
||||
}
|
||||
|
||||
|
|
@ -472,7 +472,7 @@ async function updateSessionRules() {
|
|||
ubolLog(`Add ${addRules.length} session DNR rules`);
|
||||
}
|
||||
} catch(reason) {
|
||||
ubolErr(`updateSessionRules() / ${reason}`);
|
||||
ubolErr(`updateSessionRules/${reason}`);
|
||||
response.error = `${reason}`;
|
||||
}
|
||||
return response;
|
||||
|
|
@ -667,7 +667,7 @@ async function enableRulesets(ids) {
|
|||
enableRulesetIds,
|
||||
disableRulesetIds,
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`updateEnabledRulesets/${reason}`);
|
||||
response.error = `${reason}`;
|
||||
});
|
||||
|
||||
|
|
@ -684,7 +684,7 @@ async function enableRulesets(ids) {
|
|||
ubolLog(`Available static rule count: ${count}`);
|
||||
response.staticRuleCount = count;
|
||||
}).catch(reason => {
|
||||
ubolErr(reason);
|
||||
ubolErr(`getEnabledRulesets/${reason}`);
|
||||
});
|
||||
|
||||
return response;
|
||||
|
|
@ -781,7 +781,7 @@ async function updateUserRules() {
|
|||
out.added = addRules.length;
|
||||
out.removed = removeRuleIds.length;
|
||||
} catch(reason) {
|
||||
ubolErr(`updateUserRules() / ${reason}`);
|
||||
ubolErr(`updateUserRules/${reason}`);
|
||||
out.errors.push(`${reason}`);
|
||||
} finally {
|
||||
const userRules = await getEffectiveUserRules();
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ async function registerInjectables() {
|
|||
await browser.scripting.unregisterContentScripts({ ids: toRemove });
|
||||
localRemove('$scripting.unregisterContentScripts');
|
||||
} catch(reason) {
|
||||
ubolErr(reason);
|
||||
ubolErr(`unregisterContentScripts/${reason}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ async function registerInjectables() {
|
|||
await browser.scripting.registerContentScripts(toAdd);
|
||||
localRemove('$scripting.registerContentScripts');
|
||||
} catch(reason) {
|
||||
ubolErr(reason);
|
||||
ubolErr(`registerContentScripts/${reason}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue