Talk:Greasemonkey Manual:API

From GreaseSpot Wiki
Jump to navigationJump to search

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)

coach online outlet coach bag cheap

Yesterday and baeing German born Creek Lin appeared Inspite of the overcast day if the bad weather while, he was adamant about the journey after that, the ultimate Ninety days kms absent, the street got Eight and a half a long time. He or she ended up being associated with their associate Wu Lin and also the various other the German born. Just before which, they start coming from Yunnan Shangri-La, completely along the Yangtze Lake riding, driving Several,Thousand a long way inside 66 days and nights.

The german language driver demonstrate their take a trip information for that Lake Lin, the current Some,000 kilometer journey 4 to 5 instances per year within his or her experience soon enough.