Permalink
Browse files

Only examine the URI when we have one.

(In RemoteScript._downloadFile().)

Fixes #1504
  • Loading branch information...
1 parent b63e754 commit 208469ddbded7d6a66a858b9e8149aee672756e6 @arantius committed Feb 6, 2012
Showing with 11 additions and 9 deletions.
  1. +0 −1 content/config.js
  2. +11 −8 modules/remoteScript.js
View
@@ -231,7 +231,6 @@ Config.prototype.updateModifiedScripts = function(aWhen, aSafeWin, aChromeWin) {
for (var i = 0, script; script = scripts[i]; i++) {
if (0 == script.pendingExec.length) {
- var oldScriptId = new String(script.id);
var scope = {};
Components.utils.import('resource://greasemonkey/parseScript.js', scope);
var parsedScript = scope.parse(
View
@@ -369,14 +369,17 @@ RemoteScript.prototype._downloadFile = function(
assertIsFunction(aCompletionCallback,
'_downloadFile() completion callback is not a function.');
- if (aUri == this._uri) {
- // No-op, always download the script itself.
- } else if (aUri.scheme == this._uri.scheme) {
- // No-op, always allow files from the same scheme as the script.
- } else if (!GM_util.isGreasemonkeyable(aUri.spec)) {
- // Otherwise, these are unsafe. Do not download them.
- this.cleanup('Will not download unsafe URL:\n' + aUri.spec);
- return;
+ // If we have a URI (locally installed scripts, when updating, won't!) ...
+ if (this._uri) {
+ if (aUri == this._uri) {
+ // No-op, always download the script itself.
+ } else if (aUri.scheme == this._uri.scheme) {
+ // No-op, always allow files from the same scheme as the script.
+ } else if (!GM_util.isGreasemonkeyable(aUri.spec)) {
+ // Otherwise, these are unsafe. Do not download them.
+ this.cleanup('Will not download unsafe URL:\n' + aUri.spec);
+ return;
+ }
}
// Dangerous semi-global state: The web browser persist object is stored

0 comments on commit 208469d

Please sign in to comment.