Hi I am working on a Google Chrome extension for educational purposses. How I can load JavaScript script to have access to the page.
Here is my loader.js:
s = document.createElement("script");
s.src = chrome.extension.getURL("src/content_script.js");
s.onload = function(){
this.remove();
}
document.head.appendChild(s);
and here is my content_script.js:
var formats = ytplayer.config.args.raw_player_response.streamingData.formats;
console.log("YT extension loaded!");
Problem is that I get:
Uncaught TypeError: chrome.extension.getURL is not a function at loader.js:2:26
Can someone give me suggestions on what the problem might be?
Thanks in advance!