Question

I was looking into making Firefox addons, and I need some help. Is it possible to edit an HTML page that is open in the browser with javascript? For example:

  • User types in "google.com"
  • Addon is activated
  • Javascript changes contents of "google.com" to maybe say "Hello!" at the bottom.

Of course this isn't specifically what I want to do, but a push in the right direction on how to accomplish such a task would be great. ~Carpetfizz

Was it helpful?

Solution

From within a Firefox addon this is obviously possible as many extensions do this.

If you, however, simply want to modify the DOM and nothing else than I would recommend taking a look at greasemonkey. Loads of example scripts around to do this: http://userscripts.org/

And the added benefit, if written correctly they also work in Chrome and other browsers.

OTHER TIPS

Yes, it is. You must find a tutorial about javascript DOM manipulation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top