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

194
Views
How to use "matches": ["https://www.SAMPLE_TEXT.com/*"] for every website?

I want to make an chrome extension that detects what site you are on, and it blocks you from entering unless its a site that's allowed by the program, and if it isn't allowed it redirects you to an allowed site

im trying to use this code, to redirect to another webiste:

if (document.URL.includes("https://www.facebook.com") ) {
    //something
} else {
  window.location.replace("http://stackoverflow.com");
}

and it doesn't work, even though this code works:

if (document.URL.includes("https://www.facebook.com")) {
  window.location.replace("http://stackoverflow.com");
}

i assume it works because i have this in my manifest.json:

"matches": ["https://www.facebook.com/*"]

So how can you use matches with every website?

thanks for the help!

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!