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/content/browser.js b/content/browser.js | |
index e6e9556..13d1c27 100644 | |
--- a/content/browser.js | |
+++ b/content/browser.js | |
@@ -335,6 +335,16 @@ function GM_showPopup(aEvent) { | |
GM_MenuCommander.onPopupShowing(menuCommandPopup); | |
} | |
+/** | |
+ * Clean up the menu after it hides to prevent memory leaks |
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 Break GMail Test | |
// @namespace test | |
// @include https://mail.google.com/* | |
// @include http://mail.google.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
j = 0; |
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 location.replace test | |
// @namespace test | |
// @include * | |
// @version 1 | |
// @grant GM_addStyle | |
// ==/UserScript== | |
if(window.location.href.indexOf("anchor") == -1) { | |
alert("Replacing location"); |
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); | |
} |
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
// 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 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
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
<!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
// ==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== |