This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 2067 test | |
// @namespace test | |
// @include * | |
// @version 1 | |
// @grant GM_registerMenuCommand | |
// ==/UserScript== | |
console.log("Greasemonkey script running"); | |
GM_registerMenuCommand("test", function(){}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name script1 | |
// @include * | |
// @grant unsafeWindow | |
// ==/UserScript== | |
unsafeWindow.MouseFunction = exportFunction(function (event) { | |
console.log(1); | |
}, unsafeWindow); | |
unsafeWindow.addEventListener("mousedown", unsafeWindow.MouseFunction, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Placed in the public domain, where applicable. | |
// Also licensed under CC0/WTFPL. | |
function tests() { | |
// Unloading the module doesn't always work, so changes might require a browser restart. | |
Components.utils.unload("resource://greasemonkey/third-party/MatchPattern.js"); | |
var scope = Components.utils.import("resource://greasemonkey/third-party/MatchPattern.js"); | |
var tests = [ | |
// format: [pattern, url, shouldMatch, shouldThrow] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GM_getResourceText ScriptChannel behavior | |
// @namespace test | |
// @version 1.0 | |
// @include * | |
// @grant GM_getResourceText | |
// @grant GM_getResourceURL | |
// @resource script.user.js http://dump.ventero.de/greasemonkey/resource | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head><title>GM #1494 test</title></head> | |
<body> | |
<button onclick="sendEvent();">Click</button> | |
<script> | |
var div = document.createElement("div"); | |
function sendEvent() { | |
div.click(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeUserModifiable(varName, defaultVal, parseFunc) { | |
if(typeof parseFunc !== "function") | |
parseFunc = function(a) { return a; }; | |
var currentVal = GM_getValue(varName, defaultVal); | |
GM_registerMenuCommand("Set variable " + varName, function() { | |
var val = prompt("Value for " + varName, currentVal); | |
GM_setValue(varName, val); | |
// if you need live modification, uncomment this (requires varName to be a | |
// global variable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Icon Update Test | |
// @description Test the displayed icon in the addon manager when updating this script. | |
// @namespace ventero.de | |
// @include http* | |
// @icon http://iconpacks.mozdev.org/images/firefox-world32x32.png | |
// @downloadURL https://gist.github.com/Ventero/5897253/raw/d1558153f6977f84a8288c260a3560b59577a7fc/update.user.js | |
// @updateURL https://gist.github.com/Ventero/5897253/raw/3d9118b6beca694e265648c9c46b815ac42dd367/update.meta.js | |
// @version 0.5 | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example script resource | |
console.log("resource"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GM_xhr dead object test | |
// @namespace test | |
// @include * | |
// @version 1 | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
GM_xmlhttpRequest({ | |
method: "GET", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/components/greasemonkey.js b/components/greasemonkey.js | |
index 4863722..559d178 100644 | |
--- a/components/greasemonkey.js | |
+++ b/components/greasemonkey.js | |
@@ -322,6 +322,7 @@ function startup(aService) { | |
var observerService = Components.classes['@mozilla.org/observer-service;1'] | |
.getService(Components.interfaces.nsIObserverService); | |
observerService.addObserver(aService, 'document-element-inserted', false); | |
+ observerService.addObserver(aService, 'content-document-global-created', false); | |
} |
NewerOlder