diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index 93a4330f5..efb40ed47 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -1330,7 +1330,20 @@ export class Backend { this._clipboardMonitor.stop(); } + this._setupContextMenu(options); + + void this._accessibilityController.update(this._getOptionsFull(false)); + + this._sendMessageAllTabsIgnoreResponse({action: 'applicationOptionsUpdated', params: {source}}); + } + + /** + * @param {import('settings').ProfileOptions} options + */ + _setupContextMenu(options) { try { + if (!chrome.contextMenus) { return; } + if (options.general.enableContextMenuScanSelected) { chrome.contextMenus.create({ id: 'yomitan_lookup', @@ -1348,10 +1361,6 @@ export class Backend { } catch (e) { log.error(e); } - - void this._accessibilityController.update(this._getOptionsFull(false)); - - this._sendMessageAllTabsIgnoreResponse({action: 'applicationOptionsUpdated', params: {source}}); } /**