I have the relevant entry in my manifest file:
"options_ui": {
"page": "options/options.html"
},
However I’m trying to open it upon click of a floating <div>
element, injected in the page by my content script
this is the code, the log never fires:
function LoadSetup(){
let btn_settings = document.getElementById("settings_link");
btn_settings.addEventListener("click", () => {
console.log('hello');
//browser.runtime.openOptionsPage();
browser.runtime.openOptionsPage()
.then(onOpened)
.catch(onError);
function onOpened() {
console.log(`Options page opened`);
}
function onError(error) {
console.log(`Error: ${error}`);
}
//let opening = browser.runtime.openOptionsPage();
//opening.then(onOpened, onError);
});
}