ascoltando e accedendo a tutte le richieste fatte da Firefox
-
06-07-2019 - |
Domanda
Sto sviluppando un componente aggiuntivo che modificherà tutte le richieste http fatte da firefox. Quindi, voglio ascoltare e modificare tutto l'URL della richiesta fatta dal browser da diversi siti. Come posso ottenere un accesso a diversi URL di richiesta http e modificarli. C'è qualche evento che viene generato in Firefox prima di richiedere qualsiasi richiesta http. Quindi, ti suggeriamo comunque di accedere a tutte le richieste (ajax e document.src) fatte dal browser e modificare il loro URL. Thanxs !!
Soluzione
Dovresti dare un'occhiata a tamperdata source che è un'estensione firefox per tracciare e modificare http & amp; richieste https.
Altri suggerimenti
Devi registrarti per " http-on-change-request " di nsIObserver evento. Questo ti darà ogni richiesta appena prima che sia emessa dal browser.
var {Cc, Ci} = require("chrome");
var httpRequestObserver =
{
observe: function(subject, topic, data)
{
if (topic == "http-on-modify-request") {
var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
var requestURI = httpChannel.URI.spec;
// ...
}
}
};
var observerService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
observerService.addObserver(httpRequestObserver, "http-on-modify-request", false);