[Pkg-mozext-commits] [greasemonkey] 19/30: Specify URLs for resources in GM_info.
David Prévot
taffit at moszumanska.debian.org
Thu Nov 26 00:56:29 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 9dac77c4fc9cb89b31701e41c321f6712055a81c
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Wed Nov 11 12:44:31 2015 -0500
Specify URLs for resources in GM_info.
Fixes #2281
---
modules/ipcscript.js | 11 +++++++----
modules/miscapis.js | 2 +-
modules/sandbox.js | 4 ----
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/modules/ipcscript.js b/modules/ipcscript.js
index 497ca62..4ae3b9b 100644
--- a/modules/ipcscript.js
+++ b/modules/ipcscript.js
@@ -44,11 +44,13 @@ function IPCScript(aScript, addonVersion) {
return {
'name': res.name,
'mimetype': res.mimetype,
- 'url': GM_util.getUriFromFile(res.file).spec
+ 'file_url': GM_util.getUriFromFile(res.file).spec,
+ 'gm_url': ['greasemonkey-script:', aScript.uuid, '/', res.name].join(''),
};
});
};
+
IPCScript.prototype = Object.create(AbstractScript.prototype, {
constructor: {
value: IPCScript
@@ -74,9 +76,10 @@ IPCScript.prototype.info = function() {
var resources = {};
for (var i = 0, r = null; r = this.resources[i]; i++) {
resources[r.name] = {
- 'name': r.name,
- 'mimetype': r.mimetype,
- };
+ 'name': r.name,
+ 'mimetype': r.mimetype,
+ 'url': r.gm_url,
+ };
}
return {
diff --git a/modules/miscapis.js b/modules/miscapis.js
index a0bebe4..41ff6ce 100644
--- a/modules/miscapis.js
+++ b/modules/miscapis.js
@@ -28,7 +28,7 @@ GM_Resources.prototype.getResourceURL = function(aScript, name) {
GM_Resources.prototype.getResourceText = function(name) {
var dep = this._getDep(name);
if (dep.textContent !== undefined) return dep.textContent;
- return GM_util.fileXhr(dep.url, "text/plain");
+ return GM_util.fileXhr(dep.file_url, "text/plain");
};
GM_Resources.prototype._getDep = function(name) {
diff --git a/modules/sandbox.js b/modules/sandbox.js
index 0ed20b0..6b6b414 100644
--- a/modules/sandbox.js
+++ b/modules/sandbox.js
@@ -129,7 +129,6 @@ function createSandbox(aScript, aContentWin, aUrl, aFrameScope) {
}
-
function injectGMInfo(aScript, sandbox) {
var rawInfo = aScript.info();
var scriptURL = aScript.fileURL;
@@ -138,10 +137,8 @@ function injectGMInfo(aScript, sandbox) {
sandbox.GM_info = Cu.cloneInto(rawInfo, sandbox);
var waivedInfo = Components.utils.waiveXrays(sandbox.GM_info);
-
var fileCache = new Map();
-
function getScriptSource() {
var content = fileCache.get("scriptSource");
if (content === undefined) {
@@ -169,7 +166,6 @@ function injectGMInfo(aScript, sandbox) {
Object.defineProperty(waivedInfo, 'scriptMetaStr', {
get: Cu.exportFunction(getMeta, sandbox)
});
-
}
--
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