Is there an addon that can execute javascript before the page loads?

Well, greasemonkey can execute script users, but only after the page has fully loaded. Is there a script that a user script (javascript) can accept and execute it before the downlaods page of any element. for example, As soon as the HTML file is loaded, the user script should execute so that I can prevent the loading of inline elements, such as the loading of flash, jpg, js files

+4
source share
1 answer

There is a content document, a globally created notification in the latest versions of Firefox, which fires before the page starts loading.

The Jetpack SDK contains a page mod module that uses this notification so you can write greasemonkey snippets. Such an "addon" that can execute javascript before loading the page. "

I do not know how to implement content blocking with a script.

A common way to block content is nsIContentPolicy , which is what Adblock uses.

+3
source

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


All Articles