Greasemonkey & http-on-modify-request

I am learning how to write JavaScript code that handles HTTP POST requests and responses. Since the code I want to write is pretty much a proof of concept, the Firefox extension is too strong (I would rather not deal with all of these limitations and the limitations of SSL). Then I thought if I could write it as a Greasemonkey script. So my question is this:

Can you use Mozilla event observers (http-on-modify-request, etc.) under Greasemonkey?

Please keep in mind that I learned that JavaScript is 10 minutes ago and I have no experience in this domain. However, I believe that this is in my skills and with a little research and stubbornness that I can implement. Although I am worried about trying to make something difficult.

Thank!

George.

+3
source share
1 answer

No, Greasemonkey scripts do not have access to XPCOM components. With the exception of GM_ functions , Greasemonkey scripts can only do what regular JavaScript does.

You can usually intercept AJAX calls by rewriting XMLHttpRequest()- see question 629671 . Remember that there may be interference from the JS libraries that the page may use.

+1
source

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


All Articles