1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 02:12:27 +01:00

Use temp files rather than URL arguments for :viewsource!. Also update the statusline on :redraw and add an XPCOM shim class for pseudo-XPCOM objects.

This commit is contained in:
Kris Maglione
2010-10-03 13:44:37 -04:00
parent cbed89d8ba
commit 72b6af3e6b
8 changed files with 123 additions and 25 deletions

View File

@@ -11,12 +11,13 @@
plugins.contexts = {};
function Script(file) {
let self = plugins.contexts[file.path];
let self = plugins[file.path];
if (self) {
if (self.onUnload)
self.onUnload();
return self;
}
}
else
self = { __proto__: plugins };
plugins.contexts[file.path] = self;
plugins[file.path] = self;
@@ -203,6 +204,8 @@ const IO = Module("io", {
file.append(config.tempFile);
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt('0600', 8));
Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
.getService(Ci.nsPIExternalAppLauncher).deleteTemporaryFileOnExit(file);
return io.File(file);
},
@@ -657,12 +660,11 @@ lookup:
completion: function () {
completion.charset = function (context) {
context.anchored = false;
let service = services.get("charset");
context.keys = {
text: util.identity,
description: function (charset) service.getCharsetTitle(charset)
description: services.get("charset").getCharsetTitle
};
context.generate = function () iter(service.getDecoderList());
context.generate = function () iter(services.get("charset").getDecoderList());
};
completion.directory = function directory(context, full) {