GM addStyle: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(Starting from: http://greasemonkey.mozdev.org/authoring.html)
 
(link to @require helper)
 
(38 intermediate revisions by 9 users not shown)
Line 1: Line 1:
= Syntax =
{{DISPLAYTITLE:GM_addStyle}}


'''GM_addStyle(''' ''css'' ''')'''
As of Greasemonkey 4.0, this method has been removed.


= Description =
You can `@require` a helper script to provide the same functionality, for example [https://gist.github.com/arantius/eec890c9ce4ff2f7abee896c0bba664d gm-addstyle.js].
 
Adds a string of CSS to the document.
 
Creates a new <code><style></code> element, adds the given CSS to it, and inserts it into the <code><head></code>.
 
= Examples =
 
GM_addStyle("body { color:red; }");

Latest revision as of 15:12, 8 November 2023


As of Greasemonkey 4.0, this method has been removed.

You can `@require` a helper script to provide the same functionality, for example gm-addstyle.js.