質問

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

役に立ちましたか?

解決

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top