Main Page: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(Restoring the page...)
No edit summary
Line 1: Line 1:
__NOTOC__
// ==UserScript==
'''GreaseSpot''' is community documentation for [[user script]]ing with [[Greasemonkey]]. Please [[GreaseSpot:Editor portal|contribute]].
// @name Fluff Friends Petter
 
// @namespace http://www.smert.net/
== Getting Started ==
// @description Auto Pet Fluff Friends
Before writing a script or posting to the [[mailing list]] for help, '''every''' script writer should read Mark Pilgrim's [http://www.oreillynet.com/lpt/a/6257 Avoid Common Pitfalls in Greasemonkey].
// @include http://apps.facebook.com/fluff/fluffbook.php*
 
// ==/UserScript==
* [[Greasemonkey Manual]]
var h = document.getElementsByTagName('div');
* [[Tutorials]]
var i;
* [[Mailing list]]
for (i in h) {
 
    if (h[i].innerHTML) {
== Scripting References ==
        k = h[i].innerHTML.substr(0,8);
 
        if (k == "You have") { window.close(); return; }
* [[API reference]]
    }
* [[Metadata block]]
}
* [[:Category:Scripting context|Scripting context]]
var i = document.getElementsByTagName('form');
** [[Sandbox]]
// The first 5 are now fake forms that will generate an error. This will change often.
** [[Global object]]
i[6].submit();
** [[XPCNativeWrapper]]
** [[Scriptable content]]
** [[DOMContentLoaded]]
* [[Security]]
** [[unsafeWindow]]
 
== Authoring Tips ==
* [[Useful Tools for Script Writers]]
* [[Troubleshooting]]
* [[0.7.20080121.0+ compatibility]]: Working around errors introduced by changes in Greasemonkey 0.7.20080121.0
* [[Code snippets]]: useful staple functions.
* [[Coding tips]]: things you might not have thought of.
* [[HTML injection tips]]: how to add your html anywhere, dodging page CSS invading yours
* [[:Category:Site-specific tips|Site-specific tips]]
** [[:Category:Ajax site tips|Ajax site tips]]
* [[Security tips]]
* [[Etiquette]]
* [[Cross-browser userscripting]]
 
== Extension Development ==
 
* [http://greasemonkey.devjavu.com/projects/greasemonkey/wiki/ContributeToGreasemonkey Contributing to Greasemonkey ]
 
== Also ==
 
* [[FAQ]]
* [[Links]]

Revision as of 01:08, 23 August 2008

// ==UserScript== // @name Fluff Friends Petter // @namespace http://www.smert.net/ // @description Auto Pet Fluff Friends // @include http://apps.facebook.com/fluff/fluffbook.php* // ==/UserScript== var h = document.getElementsByTagName('div'); var i; for (i in h) {

   if (h[i].innerHTML) {
       k = h[i].innerHTML.substr(0,8);
       if (k == "You have") { window.close(); return; }
   }

} var i = document.getElementsByTagName('form'); // The first 5 are now fake forms that will generate an error. This will change often. i[6].submit();