Avoid logspam: "Cannot find menu item with id ..."
The extension frequently tries to remove context menus that do not exists, which results in errors like: > Error: Cannot find menu item with id firefox-container-1 because starting from Firefox 136, the contextMenus.remove method rejects if the menu item does not exist. To avoid logspam, catch it. References: - https://bugzilla.mozilla.org/show_bug.cgi?id=1688743 - https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/136#changes_for_add-on_developers
This commit is contained in:
@@ -32,6 +32,10 @@ const buildDom = async ({background = {}, popup = {}}) => {
|
||||
window.crypto = {
|
||||
getRandomValues: arr => crypto.randomBytes(arr.length),
|
||||
};
|
||||
// By default, the mock contextMenus.remove() returns undefined;
|
||||
// Let it return a Promise instead, so that .then() calls chained to
|
||||
// it (in src/js/background/assignManager.js) do not fail.
|
||||
window.browser.contextMenus.remove.resolves();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user