0
ユーザーがアクセスしているWebページの読み込みが完了次第、クローム拡張機能を実行することはできません。javascript - ページが読み込まれるとすぐにクロム拡張機能を実行する
クリックすると拡張機能はうまく動作しますが、ページの読み込み時に自動的に実行します。
これを行う方法はありますか?
は、ここに私のマニフェスト
{
"manifest_version": 2,
"name": "Simple Text Highlighter",
"description": "This plugin notify of the word 'Simple' in the current page",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["jquery.min.js", "highlightSimple.js"],
"css": ["highlight.css"],
"run_at": "document_end"
}],
"permissions": [
"tabs",
"activeTab",
"notifications",
"http://*/",
"https://*/"
]
}
であり、ここで事前にはJavaScript
(function() {
chrome.tabs.executeScript(null, {
file: 'highlight.css'
}, function() {
chrome.tabs.executeScript(null, {
file: 'jquery.min.js'
}, function() {
chrome.tabs.executeScript(null, {
file: 'replace.js'
});
});
})
})();
おかげです。