Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda