summaryrefslogtreecommitdiff
path: root/common/components
diff options
context:
space:
mode:
authorKris Maglione <kris@vimperator.org>2009-10-31 18:42:48 -0400
committerKris Maglione <kris@vimperator.org>2009-10-31 18:42:48 -0400
commitcf03f99246d2efb4caf6bb1b2aa2810726b14bb7 (patch)
treed3c0971981407025b957862cbc1116725d5005ed /common/components
parent785c416b3d458188b4df13f307d1373534ab157a (diff)
downloadpentadactyl-cf03f99246d2efb4caf6bb1b2aa2810726b14bb7.tar.gz
Fix broken :colorscheme completion.
Diffstat (limited to 'common/components')
-rw-r--r--common/components/protocols.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/components/protocols.js b/common/components/protocols.js
index 7a7a0090..c906d031 100644
--- a/common/components/protocols.js
+++ b/common/components/protocols.js
@@ -29,8 +29,12 @@ const systemPrincipal = channel.owner;
channel.cancel(NS_BINDING_ABORTED);
delete channel;
+function dataURL(type, data)
+ "data:" + (type || "application/xml;encoding=UTF-8") + "," + escape(data);
function makeChannel(url, orig)
{
+ if (typeof url == "function")
+ url = dataURL.apply(null, url());
let uri = ioService.newURI(url, null, null);
let channel = ioService.newChannelFromURI(uri);
channel.owner = systemPrincipal;
@@ -42,7 +46,7 @@ function fakeChannel(orig)
function redirect(to, orig)
{
let html = <html><head><meta http-equiv="Refresh" content={"0;" + to}/></head></html>.toXMLString();
- return makeChannel('data:text/html,' + escape(html), orig);
+ return makeChannel(dataURL('text/html', html), orig);
}
function ChromeData() {}