0
我希望能夠單擊HTML div按鈕並重新定位當前選項卡。更改Chrome擴展程序中的選項卡位置
redirect.js
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.update(tab.id, {
url: "http://www.roblox.com/"
});
});
popup.html
<html>
<script src="redirect.js"></script>
</html>
的manifest.json
{
"name": "z",
"version": "0.1",
"description": "z",
"background": {
"page":"popup.html"
},
"manifest_version": 2,
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["redirect.js"]
}
],
"permissions": [
"tabs",
"bookmarks",
"<all_urls>",
"unlimitedStorage"
]
}
這些是我目前的腳本,它不會讓我使用onclick當我添加一個div按鈕時,我主要需要幫助。
修改後,還添加了一個可下載的鏈接。 – 2015-04-05 01:27:07