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

228
Vistas
Browser Extension: Attempting to replace page content and not working

I'm trying to get my extension to automatically change all content with "views" into "Views hidden" and something similar for "watching" (live streams), but when I run the extension it seems to do nothing. I'm thinking it might have something to do with me not knowing the permissions required or some other thing, but I can't seem to figure it out. This is my first time using javascript.

manifest.json

{"manifest_version": 2,
    "name": "SimplyWatch",
    "description": "Simply watch YouTube videos without any views, comments, or ratings data displayed for an experience unbiased by others' opinions.",
    "version": "1.0",
    "author": "Diamivore",
    "browser_action": {
        "default_icon": "tab-icon.png",
        "default_title": "SimplyWatch",
        "default_popup": "popup.html"
    },
    "permissions": ["activeTab", "tabs"],

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

content.js

const text = document.querySelectorAll('h1, h2, h3, h4, h5, p, li, td, caption, a, span')

document.addEventListener("DOMContentLoaded", function(){
    for (let i=0; i < text.length; i++) {
        if (text[i].innerHTML.includes('views')) {
            text[i].innerHTML = "Views hidden"
        } else if (text[i].innerHTML.includes('watching')) {
            text[i].innerHTML = "Watchers hidden"
        }
    }
});

Any 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