문제

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