[Pkg-mozext-commits] [greasemonkey] 04/07: Imported Upstream version 3.3~beta1
David Prévot
taffit at moszumanska.debian.org
Sat Jul 11 22:49:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 468745f5c1e0be1c4422f2ae846626ed51f0f4ee
Merge: 4af1102 50e8dd4
Author: David Prévot <david at tilapin.org>
Date: Sat Jul 11 18:35:57 2015 -0400
Imported Upstream version 3.3~beta1
META-INF/manifest.mf | 1722 -------------------------------
META-INF/mozilla.rsa | Bin 4196 -> 0 bytes
META-INF/mozilla.sf | 4 -
chrome.manifest | 2 +-
components/greasemonkey.js | 14 +-
content/addons4-overlay.js | 6 +-
content/addons4.xul | 2 +-
content/bindings.xml | 2 +-
content/browser.js | 8 +-
content/config.js | 14 +-
content/framescript.js | 14 +-
content/install.js | 4 +-
content/menucommander.js | 38 +-
content/newscript.js | 10 +-
content/options.js | 4 +-
content/scratchpad-overlay.js | 2 +-
content/scriptprefs.js | 2 +-
install.rdf | 2 +-
modules/GM_notification.js | 4 +-
modules/addons4.js | 6 +-
modules/installPolicy.js | 2 +-
modules/ipcscript.js | 4 +-
modules/menucommand.js | 2 +-
modules/miscapis.js | 6 +-
modules/parseScript.js | 16 +-
modules/remoteScript.js | 12 +-
modules/sandbox.js | 12 +-
modules/script.js | 34 +-
modules/scriptDependency.js | 2 +-
modules/scriptIcon.js | 4 +-
modules/scriptProtocol.js | 2 +-
modules/scriptRequire.js | 4 +-
modules/scriptResource.js | 4 +-
modules/stats.js | 10 +-
modules/storageBack.js | 6 +-
modules/storageFront.js | 6 +-
modules/sync.js | 30 +-
modules/third-party/MatchPattern.js | 4 +-
modules/third-party/convert2RegExp.js | 2 +-
modules/util.js | 84 +-
modules/util/alert.js | 2 +-
modules/util/enqueueRemoveFile.js | 2 +-
modules/util/getBestLocaleMatch.js | 2 +-
modules/util/getBinaryContents.js | 2 +-
modules/util/getContents.js | 2 +-
modules/util/getEditor.js | 4 +-
modules/util/getEnabled.js | 2 +-
modules/util/getPreferredLocale.js | 2 +-
modules/util/getTempDir.js | 2 +-
modules/util/getTempFile.js | 2 +-
modules/util/installScriptFromSource.js | 8 +-
modules/util/isGreasemonkeyable.js | 2 +-
modules/util/newUserScript.js | 2 +-
modules/util/openInEditor.js | 4 +-
modules/util/scriptDir.js | 4 +-
modules/util/setEditor.js | 4 +-
modules/util/setEnabled.js | 2 +-
modules/util/sha1.js | 2 +-
modules/util/showInstallDialog.js | 4 +-
modules/util/sniffGrants.js | 2 +-
modules/util/uriFromUrl.js | 2 +-
modules/util/windowId.js | 2 +-
modules/util/windowIdForEvent.js | 2 +-
modules/util/windowIsClosed.js | 2 +-
modules/util/writeToFile.js | 2 +-
modules/xmlhttprequester.js | 2 +-
66 files changed, 241 insertions(+), 1933 deletions(-)
diff --cc content/menucommander.js
index 5e38cf7,f01f7d6..16df26b
--- a/content/menucommander.js
+++ b/content/menucommander.js
@@@ -1,4 -1,4 +1,6 @@@
- Components.utils.import('resource://greasemonkey/util.js');
-Components.utils.import('chrome://greasemonkey-modules/content/util.js');
++var Cu = Components.utils;
++
++Cu.import('chrome://greasemonkey-modules/content/util.js');
var GM_MenuCommander = {
menuCommands: {}
@@@ -14,6 -14,6 +16,29 @@@ GM_MenuCommander.initialize = function(
GM_MenuCommander.clearMenuCommands);
messageManager.addMessageListener('greasemonkey:toggle-menu-commands',
GM_MenuCommander.toggleMenuCommands);
++
++ setInterval(GM_MenuCommander.sweep, 66000);
++};
++
++GM_MenuCommander.sweep = function() {
++ for (var windowId in GM_MenuCommander.menuCommands) {
++ var commands = GM_MenuCommander.menuCommands[windowId];
++
++ // Rather than mutate the (commands) array in the loop, which is failure
++ // prone, just track whether it is "empty". All commands should go
++ // stale together, or not. If empty, we can safely mutate the object
++ // (menuCommands) to clean it out, even inside its loop.
++ var empty = true;
++ for (var i in commands) {
++ var b = commands[i].browser.get();
++ if (b) empty = false;
++ }
++
++ if (empty) {
++ GM_MenuCommander.menuCommands[windowId] = null;
++ delete GM_MenuCommander.menuCommands[windowId];
++ }
++ }
};
GM_MenuCommander.menuCommandRegistered = function(aMessage) {
@@@ -24,7 -24,7 +49,7 @@@
}
var command = aMessage.data;
-- command.browser = aMessage.target;
++ command.browser = Cu.getWeakReference(aMessage.target);
GM_MenuCommander.menuCommands[windowId].push(command);
};
@@@ -45,10 -45,10 +70,11 @@@ GM_MenuCommander.toggleMenuCommands = f
};
GM_MenuCommander.commandClicked = function(aCommand) {
-- aCommand.browser.messageManager.sendAsyncMessage("greasemonkey:menu-command-clicked", {
-- index: aCommand.index,
-- windowId: aCommand.windowId
-- });
++ aCommand.browser.get().messageManager.sendAsyncMessage(
++ "greasemonkey:menu-command-clicked", {
++ index: aCommand.index,
++ windowId: aCommand.windowId
++ });
};
GM_MenuCommander.createMenuItem = function(command) {
diff --cc install.rdf
index f495128,f495128..166eb7f
--- a/install.rdf
+++ b/install.rdf
@@@ -6,7 -6,7 +6,7 @@@
<Description about="urn:mozilla:install-manifest">
<em:id>{e4a8a97b-f2ed-450b-b12d-ee082ba24781}</em:id>
-- <em:version>3.2</em:version>
++ <em:version>3.3beta1</em:version>
<em:creator>Aaron Boodman; http://youngpup.net/</em:creator>
<em:homepageURL>http://www.greasespot.net/</em:homepageURL>
<em:optionsURL>chrome://greasemonkey/content/options.xul</em:optionsURL>
diff --cc modules/scriptIcon.js
index 3ed5aa0,9715c7a..2228743
--- a/modules/scriptIcon.js
+++ b/modules/scriptIcon.js
@@@ -1,50 -1,50 +1,50 @@@
-var EXPORTED_SYMBOLS = ['ScriptIcon'];
-
-Components.utils.import('chrome://greasemonkey-modules/content/scriptDependency.js');
-Components.utils.import('chrome://greasemonkey-modules/content/util.js');
-
-var stringBundle = Components
- .classes["@mozilla.org/intl/stringbundle;1"]
- .getService(Components.interfaces.nsIStringBundleService)
- .createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
-
-ScriptIcon.prototype = new ScriptDependency();
-ScriptIcon.prototype.constructor = ScriptIcon;
-function ScriptIcon(aScript) {
- ScriptDependency.call(this, aScript);
- this.type = 'ScriptIcon';
-}
-
-ScriptIcon.prototype.__defineGetter__('fileURL',
-function ScriptIcon_getFileURL() {
- if (this._dataURI) {
- return this._dataURI;
- } else if (this._filename) {
- return GM_util.getUriFromFile(this.file).spec;
- } else {
- return 'chrome://greasemonkey/skin/userscript.png';
- }
-});
-
-ScriptIcon.prototype.__defineSetter__('fileURL',
-function ScriptIcon_setFileURL(iconURL) {
- if (/^data:/i.test(iconURL)) {
- // icon is a data scheme
- this._dataURI = iconURL;
- } else if (iconURL) {
- // icon is a file
- this._filename = iconURL;
- }
-});
-
-ScriptIcon.prototype.setMetaVal = function(value) {
- // accept data uri schemes for image mime types
- if (/^data:image\//i.test(value)) {
- this._dataURI = value;
- } else if (/^data:/i.test(value)) {
- throw new Error(stringBundle.GetStringFromName('icon.uri-image-type'));
- } else {
- var resUri = GM_util.uriFromUrl(this._script._downloadURL);
- this._downloadURL = GM_util.uriFromUrl(value, resUri).spec;
- }
-};
+var EXPORTED_SYMBOLS = ['ScriptIcon'];
+
- Components.utils.import('resource://greasemonkey/scriptDependency.js');
- Components.utils.import('resource://greasemonkey/util.js');
++Components.utils.import('chrome://greasemonkey-modules/content/scriptDependency.js');
++Components.utils.import('chrome://greasemonkey-modules/content/util.js');
+
+var stringBundle = Components
+ .classes["@mozilla.org/intl/stringbundle;1"]
+ .getService(Components.interfaces.nsIStringBundleService)
+ .createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
+
+ScriptIcon.prototype = new ScriptDependency();
+ScriptIcon.prototype.constructor = ScriptIcon;
+function ScriptIcon(aScript) {
+ ScriptDependency.call(this, aScript);
+ this.type = 'ScriptIcon';
+}
+
+ScriptIcon.prototype.__defineGetter__('fileURL',
+function ScriptIcon_getFileURL() {
+ if (this._dataURI) {
+ return this._dataURI;
+ } else if (this._filename) {
+ return GM_util.getUriFromFile(this.file).spec;
+ } else {
+ return 'chrome://greasemonkey/skin/userscript.png';
+ }
+});
+
+ScriptIcon.prototype.__defineSetter__('fileURL',
+function ScriptIcon_setFileURL(iconURL) {
+ if (/^data:/i.test(iconURL)) {
+ // icon is a data scheme
+ this._dataURI = iconURL;
+ } else if (iconURL) {
+ // icon is a file
+ this._filename = iconURL;
+ }
+});
+
+ScriptIcon.prototype.setMetaVal = function(value) {
+ // accept data uri schemes for image mime types
+ if (/^data:image\//i.test(value)) {
+ this._dataURI = value;
+ } else if (/^data:/i.test(value)) {
+ throw new Error(stringBundle.GetStringFromName('icon.uri-image-type'));
+ } else {
+ var resUri = GM_util.uriFromUrl(this._script._downloadURL);
+ this._downloadURL = GM_util.uriFromUrl(value, resUri).spec;
+ }
+};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list