ページが読み込まれた2秒後にタブを1回リロードし、その後30分間待機してタブまたはGoogle Chromeウィンドウを閉じるGoogle Chromeの拡張機能に取り組んでいます。1.js ファイルでこれらのスクリプトを試してみましたが、どれも機能していないようです
document.documentElement.style.display = 'none';
setTimeout(function() {document.documentElement.style.display = '';}, 1000);
chrome.tabs.reload()
document.documentElement.style.display = 'none';
setTimeout(function() {document.documentElement.style.display = '';}, 1000);
chrome.tabs.remove()
ここに私のmanfestファイルがあります:
{"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"content_scripts":
[{"matches": ["http://*/*"],
"js": ["1.js"],
"run_at": "document_start",
"permissions":
["tabs", "http://*/*"]}]}
彼女はそれがJavaコンソールで言っていることです:
Uncaught TypeError: Cannot call method 'reload' of undefined
皆さん、ありがとうございました