diff --git a/common/locale/en-US/styling.xml b/common/locale/en-US/styling.xml
index 4aef1c1a..c5e1a04a 100644
--- a/common/locale/en-US/styling.xml
+++ b/common/locale/en-US/styling.xml
@@ -154,12 +154,22 @@
CSS rule set (e.g., body { color: blue; }).
-
- If name (short option: -n) is provided, any existing style with the same
- name is overridden, and the style may later be deleted using name. If
- -append (short option: -a) is provided along with -name, css and
- filter are appended to its current value.
-
+ The following options are available:
+
+ - -append
+ - If provided along with -name, css and
+ filter are appended to its current value. (short name: -a)
+
+ - -agent
+ - If provided, the style is installed as an Agent sheet, which
+ applies to contents user interface widgets as well as normal
+ elements. (short name -A)
+
+ - -name=name
+ - If provided, any existing style with the same name is overridden, and the style may later be deleted using name.
+ (short name -n)
+
+
If css isn't provided, matching styles are listed.
diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm
index 7170928e..e42ac2b3 100644
--- a/common/modules/styles.jsm
+++ b/common/modules/styles.jsm
@@ -104,8 +104,9 @@ const Styles = Module("Styles", {
filter = filter.split(",");
if (name && name in names) {
var sheet = names[name];
- sheet.sites = filter;
+ sheet.agent = agent;
sheet.css = String(css);
+ sheet.sites = filter;
}
else {
sheet = Sheet(name, this._id++, filter.filter(util.identity), String(css), system, agent);
@@ -127,7 +128,7 @@ const Styles = Module("Styles", {
* @param {string or number} sheet The sheet to retrieve. Strings indicate
* sheet names, while numbers indicate indices.
*/
- get: function getget(system, sheet) {
+ get: function get(system, sheet) {
let sheets = system ? this.systemSheets : this.userSheets;
let names = system ? this.systemNames : this.userNames;
if (typeof sheet === "number")
@@ -288,7 +289,7 @@ const Styles = Module("Styles", {
css = sheet.css + " " + css;
}
}
- styles.addSheet(false, name, filter, css);
+ styles.addSheet(false, name, filter, css, args["-agent"]);
}
},
{
@@ -307,13 +308,14 @@ const Styles = Module("Styles", {
hereDoc: true,
literal: 1,
options: [
+ { names: ["-agent", "-A"], description: "Apply style as an Agent sheet" },
+ { names: ["-append", "-a"], description: "Append site filter and css to an existing, matching sheet" },
{
names: ["-name", "-n"],
description: "The name of this stylesheet",
completer: function () [[k, v.css] for ([k, v] in Iterator(styles.userNames))],
type: modules.CommandOption.STRING
- },
- { names: ["-append", "-a"], description: "Append site filter and css to an existing, matching sheet" }
+ }
],
serialize: function () [
{
diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS
index 9acae799..a40b38ab 100644
--- a/pentadactyl/NEWS
+++ b/pentadactyl/NEWS
@@ -44,6 +44,7 @@
* Added "transliterated" option to 'hintmatching'.
* Added -javascript option to :abbrev and :map.
* Added several new options to :map.
+ * Added -agent flag to :style
* Removed the :source line at the end of files generated by
:mkpentadactylrc.
* gf now toggles between source and content view.