From https://bugzilla.mozilla.org/show_bug.cgi?id=1443749#c1
ISTM that notes is calling sidebarAction.open all the time. You should first check if it is open by calling sidebarAction.isOpen.
browser.browserAction.onClicked.addListener(() => {
browser.sidebarAction.isOpen({}).then((isOpen) => {
if (! isOpen) {
browser.sidebarAction.open();
}
});
});
and
browser.contextMenus.onClicked.addListener((info) => {
/**
* If the `isOpen` API is available then use it. If we don't use that in Firefox 60+ then
* the sidebar will flicker and cause all sorts of bugs.
*
* Opening the sidebar triggers `isEditorReady`.
*
* Ref: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/sidebarAction/isOpen
*/
if (browser.sidebarAction.hasOwnProperty('isOpen')) {
browser.sidebarAction.isOpen({}).then((isOpen) => {
if (! isOpen) {
browser.sidebarAction.open();
}
// then send selection text to Editor.js once editor instance is initialized and ready
sendSelectionText(info.selectionText);
});
} else {
browser.sidebarAction.open();
// then send selection text to Editor.js once editor instance is initialized and ready
sendSelectionText(info.selectionText);
}
});
Causes: Error: sidebarAction.open may only be called from a user input handler background.js:255:9