I am working on a project in that we prioritize HTTP resource load requests. To reorder HTTP requests, we need to either delay the HTTP requests to send, or either cancel them, or re-initiate them later.
The following code snippet can be used to cancel an HTTP request in Firefox Extension.
observe: function(aSubject, aTopic, aData) {
if (aTopic == 'http-on-modify-request') {
.....
aSubject.cancel(Components.results.NS_BINDING_ABORTED);
....
}
}
But is there a way to delay (lazy loading resources) an HTTP request or re-initiate HTTP requests that were canceled while parsing a web page using the above code.
source
share