ignoreChromeError -> messaging; use it in editor's menu update

This commit is contained in:
tophf 2017-03-29 03:57:21 +03:00
parent e384657668
commit 668e3a7b56
4 changed files with 8 additions and 7 deletions

View File

@ -23,6 +23,7 @@ globals:
activateTab: false activateTab: false
stringAsRegExp: false stringAsRegExp: false
wildcardAsRegExp: false wildcardAsRegExp: false
ignoreChromeError: false
# localization.js # localization.js
template: false template: false
t: false t: false

View File

@ -79,7 +79,7 @@ function onBackgroundMessage(request, sender, sendResponse) {
case 'prefChanged': case 'prefChanged':
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
if (typeof request.value == 'boolean' && contextMenus[request.prefName]) { if (typeof request.value == 'boolean' && contextMenus[request.prefName]) {
chrome.contextMenus.update(request.prefName, {checked: request.value}); chrome.contextMenus.update(request.prefName, {checked: request.value}, ignoreChromeError);
} }
break; break;
} }
@ -228,8 +228,3 @@ function injectContentScripts() {
} }
}); });
} }
function ignoreChromeError() {
chrome.runtime.lastError; // eslint-disable-line no-unused-expressions
}

View File

@ -1214,7 +1214,7 @@ function toggleContextMenuDelete(event) {
this.selectionStart != this.selectionEnd || this.selectionStart != this.selectionEnd ||
this.somethingSelected && this.somethingSelected() this.somethingSelected && this.somethingSelected()
), ),
}); }, ignoreChromeError);
} }
} }

View File

@ -191,6 +191,11 @@ function wildcardAsRegExp(s, flags) {
} }
function ignoreChromeError() {
chrome.runtime.lastError; // eslint-disable-line no-unused-expressions
}
const configureCommands = { const configureCommands = {
url: navigator.userAgent.includes('OPR') url: navigator.userAgent.includes('OPR')
? 'opera://settings/configureCommands' ? 'opera://settings/configureCommands'