Talk:Greasemonkey Manual:API: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(→‎wrap bracelet: new section)
m (Reverted edits by Chan016 (talk) to last revision by Arantius)
Line 24: Line 24:


: It is the general policy of Greasemonkey to ''not'' implement a special API just to build something that a user script can easily do on its own.  Something like this is a perfect candidate for a reusable component in the [[:Category:@require Library]]. [[User:Arantius|Arantius]] 12:55, 27 July 2010 (UTC)
: It is the general policy of Greasemonkey to ''not'' implement a special API just to build something that a user script can easily do on its own.  Something like this is a perfect candidate for a reusable component in the [[:Category:@require Library]]. [[User:Arantius|Arantius]] 12:55, 27 July 2010 (UTC)
== Beats By Dre Headphones ==
"The wood light Hou heat sliced ground to smile:"Yes, that handle short Bi not know <a href="http://cheapbeatsbydre.charmclub-uk.com">cheapbeatsbydre.charmclub-uk.com</a> is how difference treasure, the week moves to unexpectedly meet head on guest's night but shot with this and with one action beats the drive of guest's night.
The face that sees guest's night still puts where."The white works properly mountain to slowly nod <a href="http://cheapbeatsbydre.charmclub-uk.com">Beats By Dre Headphones</a> to immediately after say with smile:"Light Hou elder brother, the week moves the strength that can be not only only with the that handle short Bi, another place just of fingerprint, if I guess quite good.
He must be the true oral tradition that got a purple <a href="http://cheapbeatsbydre.charmclub-uk.com">monster beats by dre</a> movie star, water fastens difficult to understand Qing world the Xuan is strange, although the fire Hou still differs too manily,the fire Hou has already had the strength of self-preservation, we need not worry about he too much.
== wrap bracelet ==
Is hesitant repeatedly, hold to work properly sword but have never dared to act rashly, can be moved by week from he nearby wear pass by.See the week <a href="http://www.wrapbracelets.us">wrap bracelet</a> move the appearance that flies inside the sea of blood here, it is exhausting to can have no him that sort.
The week moves such as the big bird-sort steadily and forward the side fly far.This works properly a sea territory forehead up emit sweat, without extra trouble take out oneself, the Xuan iron for taking part in a game to make card, at make several and red line in card, more than 700 each difference of breathings of a little bit red, he can clearly see the week leave up that license plate moves of position, he sees  in the week after moving to exceed him and again and easily exceed his front, that contestant, -before raising into Zhao.
"He- succeeded ……"This works properly a sea territory the surprised Cha is again upset again, does he leave a Lu to still have two positions now.But he sees at this time that week's moving be unexpectedly and still continuing <a href="http://www.wrapbracelets.us">chan luu sale</a> to move forward and caught up with the 20th, Dai ……even keep catching up with son Qin.

Revision as of 21:36, 14 November 2012

GM_getObject/GM_setObject

I think these two additional functions might be handy:

function GM_getObject( name, default )
function GM_setObject( name, value )

Implementation:

function GM_getObject(name, defaultValue) {
	var s = GM_getValue(name);

	if (s === undefined) {
		return defaultValue;
	}
	else {
		return JSON.parse(s);
	}
}

function GM_setObject(name, value) {
	GM_setValue(name, JSON.stringify(value));
}
It is the general policy of Greasemonkey to not implement a special API just to build something that a user script can easily do on its own. Something like this is a perfect candidate for a reusable component in the Category:@require Library. Arantius 12:55, 27 July 2010 (UTC)