Skip to content

Instantly share code, notes, and snippets.

@arantius
arantius / gm-xhr-test-case.user.js
Created March 26, 2011 22:04
test case for GM_xmlhttpRequest
// ==UserScript==
// @name GM_xmlhttpRequest Basic Test
// ==/UserScript==
dump('starting gm_xhr ...');
try {
GM_xmlhttpRequest({
method: "GET",
@arantius
arantius / gm_rmc-access-key-test.user.js
Created March 27, 2011 21:07
GM_registerMenuCommand Access Key Test
// ==UserScript==
// @name GM_registerMenuCommand Access Key Test
// ==/UserScript==
GM_registerMenuCommand(
"Menu command, with Access Key",
function() { dump("Menu command w/Access Key runs.\n"); },
null, null,
"A");
@arantius
arantius / gm_rmc-accelerator-test.user.js
Created March 27, 2011 21:10
GM_registerMenuCommand Accelerator Test
// ==UserScript==
// @name GM_registerMenuCommand Accelerator Test
// ==/UserScript==
GM_registerMenuCommand(
"Menu command, with Accelerator",
function() { dump("Menu command w/Accelerator runs.\n"); },
"c", "control shift");
@arantius
arantius / gm_rmc-simple-test.user.js
Created March 27, 2011 21:03
the simplest possible GM_registerMenuCommand test
// ==UserScript==
// @name GM_registerMenuCommand Simple Test
// ==/UserScript==
GM_registerMenuCommand(
"Simple menu command",
function() { dump("Simple menu command runs.\n"); });
@arantius
arantius / gm-rmc-accelerator-tester.user.js
Created April 1, 2011 18:51
GM_registerMenuCommand() accelerator tester
// ==UserScript==
// @name GM_registerMenuCommand() accelerator tester
// @namespace http://arantius.com/misc/greasemonkey/
// @description A flexible test script for examining if/how GM_rmc's accelerator keys work
// @include about:blank#GM_rmc
// @resource ui.html https://gist.github.com/raw/898642/ui.html
// ==/UserScript==
var windowId = String(Math.random()).substr(2);
@arantius
arantius / gm-rmc-randomized-test.user.js
Created April 4, 2011 21:59
Generates a random ID, puts it in the page, and in a registered menu command
// ==UserScript==
// @name GM_registerMenuCommand() Randomized Test
// @include http*
// ==/UserScript==
var id = String(Math.random()).substr(3);
GM_registerMenuCommand(
"Menu command "+id,
function() { unsafeWindow.dump("Menu command "+id+" runs.\n"); });
@arantius
arantius / gm_xhr-alert-test.user.js
Created April 6, 2011 19:26
GM_xmlhttpRequest Alert Interference Test
// ==UserScript==
// @name GM_xmlhttpRequest Alert Interference Test
// @include http*
// ==/UserScript==
// Uses unsafeWindow.dump() because of
// https://github.com/greasemonkey/greasemonkey/issues#issue/1229
function doSampleXhr() {
unsafeWindow.dump('starting gm_xhr ...');
@arantius
arantius / alert+settimeout.user.js
Created April 8, 2011 20:20
alert() + setTimeout() tester
// ==UserScript==
// @name alert() + setTimeout() tester
// @include http*
// ==/UserScript==
alert('alert 1');
setTimeout(function() { alert('alert 2'); }, 0);
@arantius
arantius / duplicate-metadata-test.user.js
Created April 12, 2011 18:52
Test what happens when single-value metadata (@name, @description, etc.) is listed twice.
// ==UserScript==
// @name Duplicate Metadata Test (FIRST)
// @name Duplicate Metadata Test (SECOND)
// @namespace https://github.com/arantius#FIRST
// @namespace https://github.com/arantius#SECOND
// @description Test what happens when single-value metadata (@name, @description, etc.) is listed twice. Each should say SECOND or 2, not FIRST or 1. (FIRST)
// @description Test what happens when single-value metadata (@name, @description, etc.) is listed twice. Each should say SECOND or 2, not FIRST or 1. (SECOND)
// @icon http://www4d.wolframalpha.com/Calculate/MSP/MSP61719f4fag722076ge000005behc1e440b1gcg6?MSPStoreType=image/gif&s=62&w=8&h=20
// @icon http://www4d.wolframalpha.com/Calculate/MSP/MSP594619f4f1g9g975d57400002ga4i0gf41iceeef?MSPStoreType=image/gif&s=34&w=8&h=20
// @version 1
@arantius
arantius / icon-change.user.js
Created April 14, 2011 17:28
Test what happens when you edit the @ICON line of a script.
// ==UserScript==
// @name Icon change tester.
// @description Test what happens when you edit the @icon line of a script.
// @namespace https://github.com/arantius
// @include http*
// @exclude *gist*
// @icon http://iconpacks.mozdev.org/images/deerpark-lite.png
// ==/UserScript==
/*