var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(
Components.interfaces.nsIIOService,
);
var ch = ios.newChannel("https://www.example.com/", null, null);Changing the Priority of HTTP Requests (Non-Standard)
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
if (ch instanceof Components.interfaces.nsISupportsPriority) {
ch.priority = Components.interfaces.nsISupportsPriority.PRIORITY_LOWEST;
}var req = new XMLHttpRequest();
req.open("GET", "https://www.example.com", false);
if (req.channel instanceof Components.interfaces.nsISupportsPriority) {
req.channel.priority =
Components.interfaces.nsISupportsPriority.PRIORITY_LOWEST;
}
req.send(null);// assuming we already have a nsIChannel from above
if (ch instanceof Components.interfaces.nsISupportsPriority) {
ch.adjustPriority(-1);
}