How to preprocess HTML before it's loaded and parsed by Mozilla?

对着背影说爱祢 提交于 2019-12-13 12:35:42

问题


I need a way to process HTML before it's actually loaded and parsed by Mozilla. Is there any content listener that I can use in my Firefox extension?


回答1:


Add an Event Listener to the gBrowser global object, making sure to set usecapture to true. You could also intercept the response.




回答2:


Do you mean something like greasemonkey? Sorry, I don't know enough about Firefox extensions. The Greasemonkey website is blocked here in China and my VPN does not work at the moment, but maybe they are open source. Then you can see what they do, if writing a greasemonkey skript is not what you want.



来源:https://stackoverflow.com/questions/3803115/how-to-preprocess-html-before-its-loaded-and-parsed-by-mozilla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!