Is there any way to exexute a javascript, that navigates the browser to some url, when user clicks on extension icon?
Right-click the extension's icon located in the toolbar and then select “Manage Extensions.” Scroll down until you see “Allow Access to File URLs” and toggle the switch to the “On” position.
To use the feature, visit a web page and simply highlight the text you want to create a link to, then right-click and choose Copy Link to Highlight from the dropdown menu. This will generate a URL that includes a hash (#) symbol.
On click — meaning the extension is able to see and alter what's in your browser only when you actively click it (and then only for the site that's currently open in that specific tab)
You can use the following code:
chrome.tabs.update({
url: "http://www.example.com/"
});
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