mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 21:18:00 +01:00
Automagically linkify help index descriptions.
This commit is contained in:
@@ -23,16 +23,22 @@ const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].getService(Ci.nsIPr
|
||||
|
||||
function dataURL(type, data) "data:" + (type || "application/xml;encoding=UTF-8") + "," + escape(data);
|
||||
function makeChannel(url, orig) {
|
||||
if (url == null)
|
||||
return fakeChannel();
|
||||
if (typeof url === "function")
|
||||
url = dataURL.apply(null, url());
|
||||
let uri = ioService.newURI(url, null, null);
|
||||
let channel = ioService.newChannelFromURI(uri);
|
||||
channel.contentCharset = "UTF-8";
|
||||
channel.owner = systemPrincipal;
|
||||
channel.originalURI = orig;
|
||||
return channel;
|
||||
try {
|
||||
if (url == null)
|
||||
return fakeChannel();
|
||||
if (typeof url === "function")
|
||||
url = dataURL.apply(null, url());
|
||||
let uri = ioService.newURI(url, null, null);
|
||||
let channel = ioService.newChannelFromURI(uri);
|
||||
channel.contentCharset = "UTF-8";
|
||||
channel.owner = systemPrincipal;
|
||||
channel.originalURI = orig;
|
||||
return channel;
|
||||
}
|
||||
catch (e) {
|
||||
Components.utils.reportError(e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
function fakeChannel(orig) makeChannel("chrome://dactyl/content/does/not/exist", orig);
|
||||
function redirect(to, orig, time) {
|
||||
|
||||
Reference in New Issue
Block a user