Create Addon to modify JavaScript data before executing in Firefox.

I want to create an addon for firefox that should check every javascript on the download page. And if there is code that is not allowed, it must be blocked or changed (it is part of XSS Protection). But I do not know how to implement this. I tried to create an http-on-modify-request observer, and so I have access to scripts. But how can I change them before Firefox executes it?

My second test was to create an addon similar to the Flashblock addon. So I created a CSS file and attached script tags to an XML file. In the xml file, I create a placeholder and replace javascript. When I started the page and looked into the DOM-Inspector, it works fine ... there are div tags, not javascript tags. The problem is that Firefox was still executing the original javascripts, and therefore my test failed.

Do I have any clues?

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

+6
source share
1 answer
+1
source

Source: https://habr.com/ru/post/892758/


All Articles