mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-01 05:03:32 +02:00
Fix some bugs.
--HG-- branch : groups
This commit is contained in:
@@ -134,6 +134,10 @@ var Contexts = Module("contexts", {
|
|||||||
dactyl.trapErrors("cleanup", hive);
|
dactyl.trapErrors("cleanup", hive);
|
||||||
dactyl.trapErrors("destroy", hive);
|
dactyl.trapErrors("destroy", hive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (let plugin in values(plugins.contexts))
|
||||||
|
if (plugin.onUnload)
|
||||||
|
dactyl.trapErrors("onUnload", plugin);
|
||||||
},
|
},
|
||||||
|
|
||||||
context: null,
|
context: null,
|
||||||
@@ -162,8 +166,8 @@ var Contexts = Module("contexts", {
|
|||||||
this.groupList.unshift(group);
|
this.groupList.unshift(group);
|
||||||
this.groupMap[name] = group;
|
this.groupMap[name] = group;
|
||||||
this.hiveProto.__defineGetter__(name, function () group[this._hive]);
|
this.hiveProto.__defineGetter__(name, function () group[this._hive]);
|
||||||
delete this.groups;
|
|
||||||
}
|
}
|
||||||
|
delete this.groups;
|
||||||
return group;
|
return group;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -309,7 +313,7 @@ var Contexts = Module("contexts", {
|
|||||||
|
|
||||||
if (!group)
|
if (!group)
|
||||||
group = contexts.addGroup((isRuntime ? "" : "script-") +
|
group = contexts.addGroup((isRuntime ? "" : "script-") +
|
||||||
commands.nameRegexp.iterate(path.replace(/\..*/, ""))
|
commands.nameRegexp.iterate(path.replace(/\.[^.]*$/, ""))
|
||||||
.join("-"),
|
.join("-"),
|
||||||
"Script group for " + file.path,
|
"Script group for " + file.path,
|
||||||
null, false);
|
null, false);
|
||||||
|
|||||||
@@ -288,17 +288,17 @@ var Marks = Module("marks", {
|
|||||||
function matchhost(url) !host || util.isDomainURL(url, host);
|
function matchhost(url) !host || util.isDomainURL(url, host);
|
||||||
function match(marks) (k for ([k, v] in Iterator(marks)) if (timespan.contains(v.timestamp) && matchhost(v.location)));
|
function match(marks) (k for ([k, v] in Iterator(marks)) if (timespan.contains(v.timestamp) && matchhost(v.location)));
|
||||||
|
|
||||||
for (let [url, local] in storage["local-marks"])
|
for (let [url, local] in marks._localMarks)
|
||||||
if (matchhost(url)) {
|
if (matchhost(url)) {
|
||||||
for (let key in match(local))
|
for (let key in match(local))
|
||||||
delete local[key];
|
delete local[key];
|
||||||
if (!Object.keys(local).length)
|
if (!Object.keys(local).length)
|
||||||
storage["local-marks"].remove(url);
|
marks._localMarks.remove(url);
|
||||||
}
|
}
|
||||||
storage["local-marks"].changed();
|
marks._localMarks.changed();
|
||||||
|
|
||||||
for (let key in match(storage["url-marks"]))
|
for (let key in match(marks._urlMarks))
|
||||||
storage["url-marks"].remove(key);
|
marks._urlMarks.remove(key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,9 +84,6 @@ var IO = Module("io", {
|
|||||||
|
|
||||||
destroy: function destroy() {
|
destroy: function destroy() {
|
||||||
services.downloadManager.removeListener(this.downloadListener);
|
services.downloadManager.removeListener(this.downloadListener);
|
||||||
for (let [, plugin] in Iterator(plugins.contexts))
|
|
||||||
if (plugin.onUnload)
|
|
||||||
plugin.onUnload();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user