mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-08 11:54:13 +01:00
Fix some cleanup issues. Better error pages for bad dactyl: URLs. Remove some dead code. Other cleanup.
This commit is contained in:
@@ -254,12 +254,14 @@ var Styles = Module("Styles", {
|
||||
this.cleanup();
|
||||
this.allSheets = {};
|
||||
|
||||
services["dactyl:"].providers["style"] = function styleProvider(uri) {
|
||||
let id = /^\/(\d*)/.exec(uri.path)[1];
|
||||
if (Set.has(styles.allSheets, id))
|
||||
return ["text/css", styles.allSheets[id].fullCSS];
|
||||
return null;
|
||||
};
|
||||
update(services["dactyl:"].providers, {
|
||||
"style": function styleProvider(uri, path) {
|
||||
let id = parseInt(path);
|
||||
if (Set.has(styles.allSheets, id))
|
||||
return ["text/css", styles.allSheets[id].fullCSS];
|
||||
return null;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
cleanup: function cleanup() {
|
||||
|
||||
Reference in New Issue
Block a user