Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

471
Views
Google Chrome extension - how to inject a content script?

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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!