2
我正在撰寫(或正在嘗試寫入)我的第一個Chrome擴展程序,而且我無法弄清我收到的這個錯誤。我的後臺代碼是我的Chrome擴展程序中出現「未知錯誤」
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
console.log('works?');
chrome.tabs.executeScript(null, {code:"document.body.style.fontSize = 20"});
console.log('print again');
</script>
</body>
當我嘗試運行此擴展我得到的錯誤:tabs.executeScript期間 錯誤:未知的錯誤。擴展/擴展進程bindings.js:85
有沒有人知道這可能是什麼或如何解決它?當我不包含行chrome.tabs.executeScript時,我得到沒有錯誤,無論我爲chrome.tabs.executeScript的參數寫什麼,我都會收到錯誤。 我還收到錯誤,當我包含chrome.tabs.executeScript裏面的功能,每當瀏覽器操作被點擊
任何幫助將不勝感激,謝謝!
非常感謝!它在我關閉擴展頁面並將其放入函數時起作用! – user1013869