Cannot use executeScript with file

I am trying to enter a script with chrome.tabs.executeScript (), but I get this error:

Runtime.lastError failed while running tabs.executeScript: Failed to load file: "contentscript.js"

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { // Inject script into current tab chrome.tabs.executeScript(tab.id, {file: 'contentscript.js'}); } 

My manifest has tabs and the exact resolution of the host .

+5
source share

Source: https://habr.com/ru/post/1201673/


All Articles