How to handle every request in a Firefox extension? -
i'm trying capture , handle every single request web page, or plugin in make. example, if open console, , enable net logging, when http request sent, console shows there. want capture every link , call function when video loaded flash player (which logged in console also, if http). can guide me should do, or should started?
edit: want able cancel request , handle way if needed.
you can use jetpack sdk of need, believe. if register system events , listen http-on-modify-request, can use nsihttpchannel methods modify response , request
let { ci } = require('chrome'); let { on } = require('sdk/system/events'); let { newuri } = require('sdk/url/utils'); on('http-on-modify-request', function ({subject, type, data}) { if (/google/.test(subject.uri.spec)) { subject.queryinterface(ci.nsihttpchannel); subject.redirectto(newuri('http://mozilla.org')); } });
additional info, "intercepting page loads"
Comments
Post a Comment