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

85
Views
¿Cómo acceder al html de una página desde una extensión de Firefox?

Estoy tratando de desarrollar una extensión para Firefox. El problema es que no puedo averiguar cómo acceder al html de la pestaña activa cuando se presiona el botón de la barra de herramientas. Todavía no he agregado el botón de la barra de herramientas, lo haré una vez que la función getHTML funcione.

Este es el archivo de manifiesto.

 { "manifest_version": 2, "name" : "Example", "version": "1.0", "description": "Example extension", "content_scripts": [ { "matches": ["<all_urls>"], "js": ["js/content.js"] } ], "background": { "scripts": ["example.js"] }, "permissions": [ "tabs", "storage", "activeTab", "webRequest", ] }

Este es el script de fondo ejemplo.js:

 function getHTML() { browser.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) { // and use that tab to fill in out title and url var tab = tabs[0]; var tabId = tab.id; browser.tabs.executeScript(tabId, { code : "console.log(document.body.innerHTML)" })})}; getHTML()

¿Qué estoy haciendo mal?

Gracias por adelantado.

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!