我想在Chrome擴展上點擊一下即可打開網頁上的所有鏈接。我爲此嘗試,但我沒有得到任何結果。請幫我...只需點擊一下Chrome擴展程序,即可打開網頁上的所有鏈接。
我manifist.json文件:
{
"name": "Open Links in New Tabs",
"version": "1.0",
"description": "open all link in page on new tabs with one click",
"background_page" : "background.html",
"browser_action": {
"default_icon": "icon.png"
},
"permissions":
["tabs"],
"manifest_version": 2
}
background.html文件:
<!doctype html>
<html>
<head>
<script src="background.js"></script>
</head>
<body>
</body>
</html>
background.js文件:
for(i = 0; i < document.links.length; i++)
{ chrome.tabs.create({active: true, url: document.links[i].href});}
請解釋任何問題。謝謝
可能重複[chrome擴展 - 打開頁面上的所有鏈接在新標籤上點擊一下](http://stackoverflow.com/questions/23534169/chrome-extensions-open - 全鏈接在頁面上,新的選項卡,與一點擊) – Xan