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

278
Vistas
JavaScript – Applying CSS file to a page only if certain conditions are met

So... I am in the process of making a Chrome Browser extension as a practice assignment.

Right now, I have made a manifest.json file that contains a part like the following:

"content_scripts": [
    {
        "matches": ["<all_urls>"],
        "js": ["content.js"]
    }

]

The intention here is that for all sites opened via the Chrome browser, the content.js will be at work.

Before getting into what I intend to have the content.js as, I have made an index.html (image of it by clicking the 1 here)1

Also, I have made main.css and looks like the following:

html body {
    filter: grayscale(70);
}

Basically, index.html will be what the "New Tab" will look like. So, on that page, for example, if a user checkmarks "YouTube", I want the content.js to have something like: "If the YouTube checkmark is checked AND the website domain matches www.youtube.com, then apply main.css to that website's page"

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