Nella mia cartella StackOverflow, ho stackoverflow.ico
e 2 file muggenti. Quando lo importa su Chrome, mostra l'icona nella barra degli indirizzi, ma quando faccio clic su di esso, Chrome non apre alcuna nuova scheda. Che cosa sto facendo di sbagliato?Estensione Chrome: come si apre un collegamento in una nuova scheda?
manifest.json
{
"name": "Stackoverflow",
"version": "1",
"browser_action":
{
"default_icon": "stackoverflow.ico"
},
"background":
{
"page": "index.html"
},
"permissions": ["tabs"],
"manifest_version": 2
}
index.html
<html>
<head>
<script>
chrome.browserAction.onClicked.addListener(function(activeTab)
{
var newURL = "http://stackoverflow.com/";
chrome.tabs.create({ url: newURL });
});
</script>
</head>
</html>
Grazie. Ha funzionato ora! – Sakura