Opening a new tab by clicking on the extension icon in Chrome

How to make it so that when you click on the extension icon in Google Chrome, not a popup pops up, but a script is executed (gen.js) and the tab opened?

Author: Helisia, 2013-08-16

1 answers

In background.html:

<script type="text/javascript" src="gen.js"></script>
<script type="text/javascript" src="background.js"></script>

In the background.js:

chrome.browserAction.onClicked.addListener(abc);

Gen.js:

function abc() {
....
chrome.tabs.create({url:"http://mail.ru"});
}
 2
Author: Виталий Поздняков, 2013-08-16 07:51:03