1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-08 08:34:12 +01:00

Prevent stylesheets from being appended to the list more than once.

This commit is contained in:
Kris Maglione
2010-09-18 05:13:47 -04:00
parent 2c4525e86a
commit ce179ee3b6
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com> // Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com>
// Copyright (c) 2009-2010 by Kris Maglione <maglione.k at Gmail>
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
@@ -50,7 +51,7 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, {
passwords: "Saved passwords", passwords: "Saved passwords",
sessions: "Authenticated sessions", sessions: "Authenticated sessions",
}; };
// These builtin methods don't support hosts or have // These builtin methods don't support hosts or otherwise have
// insufficient granularity // insufficient granularity
this.addItem("cookies", { this.addItem("cookies", {
description: "Cookies", description: "Cookies",

View File

@@ -107,12 +107,13 @@ const Styles = Module("Styles", {
sheet.filter = filter; sheet.filter = filter;
sheet.css = String(css); sheet.css = String(css);
} }
else else {
sheet = Sheet(name, this._id++, filter.filter(util.identity), String(css), system, agent); sheet = Sheet(name, this._id++, filter.filter(util.identity), String(css), system, agent);
sheets.push(sheet);
}
if (!lazy) if (!lazy)
sheet.enabled = true; sheet.enabled = true;
sheets.push(sheet);
if (name) if (name)
names[name] = sheet; names[name] = sheet;