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

305
Views
How to open an extension from javascript?

is it possible to launch an extension from javascript?

for example in my code i check if a specific keyword is in the url with:

let keyword = "xyz"

if (window.location.href.indexOf("keyword") > -1) {
            window.location.replace("https://www.google.com/");
        }

and if it is in the url, i get redirect to google.com

the problem is that if i try to open my index.html, it opens it as a website instead of an extension popup

so how can you open it as an extension, if you can?

thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to use chrome.runtime.getURL('path/to/file').

https://developer.chrome.com/docs/extensions/reference/runtime/#method-getURL

Also keep the web_accessible_resources in your manifest.json in mind when using this.

https://developer.chrome.com/docs/extensions/mv3/manifest/web_accessible_resources/

about 4 years ago · Juan Pablo Isaza Report
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!