How do I make it that when I click my extension button in the upper right, it redirects me to another page? My manifest looks a little something like this.
{
// Extension Info
"manifest_version": 2,
"name": "Extension",
"version": "0.0.1",
"description": "Text",
// Action
"browser_action": {
"default_icon": "icon_64.png",
"default_popup": "popup.htm"
},
// Other decorative stuff
"icons": {
"128": "icon_128.png",
"64": "icon_64.png",
"16": "icon_16.png"
}
}
And popup looks like this
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
window.open("http://website.com",'_blank');
</script>
</head>
<body>
<h1>Redirecting...</h1>
</body>
</html>
Any Ideas? Thanks! -SensiAking1
In background script, implement an onclick handler for browserAction button as follows.
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.tabs.update({ url: "http://website.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