NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
Alternative to using GM_addStyle with validation and "pretty" simple formatting.
To be used with @require
. It won't do any good if installed directly.
NOTE: Firefox 3.6.x has some issues so validation and formatting will not occur if the ability is not present.
More details to come as they develop. :)
@run-at document-start
in this implementation depending on the status of upstream#1384... In these situations use the callback object parameter instead.– | – | ||||
– | – | ||||
– | – | – | – | ||
– | – | – | |||
– | |||||
– | – | – | – | – | |
– | – | ||||
– | – | ||||
– | – | – | |||
– | – | – | – | ||
– | – | ||||
– |
Quick example until full API listing can be created (possibly some more features too)
let styleNode = GM_setStyle({
// OPTIONAL: Set the node to reuse... use null to return cssText instead of styleNode
node: styleNode,
// OPTIONAL: Set the media attribute
media: "screen, projection",
// OPTIONAL: The CSS to use... supports CDATA Multi-line XMLLists DIRECTLY!
data: ".selectorA { rule: value; } #selectorB { position: fixed }",
// OPTIONAL: How to reassemble the rules... default is newline character
space: "\n",
// OPTIONAL: Callback usually for use with @run-at document-start
callback: function () {
console.log([
this.node,
this.data
].join('\n'));
}
});
Rating: 4