Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Addon to modify JavaScript Data before executed on Firefox

i want to create an addon for firefox, that should check every JavaScript on a loading page. And if there is a Code, which is not allowed it should be blocked or modiefied (it is a part of XSS Protection). But i don't know, how to implement this. I tried to create an http-on-modify-request observer and so i have an access to the scripts. But how can i modify them before Firefox execute it?

My second trial was to create an addon like the Flashblock addon. So i made a CSS-file and bind the script tags to a xml-file. In the xml file i create a placeholder and replace the javascript. When i start a page and look into DOM-Inspector it works fine... there are div-tags instead of javascript tags. The Problem is, that Firefox still executed the original javascripts and so my trial failed.

Have anybody some tips for me?

ps: sry, for my english, but english is not my native language

like image 315
David Avatar asked Jul 14 '11 14:07

David


1 Answers

I think you're looking for nsITraceableChannel: http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/

like image 64
Nickolay Avatar answered Oct 06 '22 22:10

Nickolay