I know it's possible to show a popup when clicking on the extension icon (top right of the browser, to the right of the address bar): chrome.browserAction
Also here is how to create an Options page, that will often have an URL like:
chrome-extension://ofodsfyizzsaaahskdhfsdffffdsf/options.html
Question: how is it possible to make that a single click on the extension icon opens the options.html page in a new tab?
You can use something like this in your background script:
background.js
chrome.browserAction.setPopup({popup:''}); //disable browserAction's popup
chrome.browserAction.onClicked.addListener(()=>{
chrome.tabs.create({url:'options.html'});
});
manifest.json
...
"browser_action": {
"default_title": "Options"
},
"background": {
"scripts": ["background.js"],
"persistent": true
}
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With