Skip to content

Commit

Permalink
Call default onDrop() only when there are non-user-scripts.
Browse files Browse the repository at this point in the history
Fixes #1663
  • Loading branch information
arantius committed Jan 24, 2013
1 parent 9db6499 commit 819117a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion content/addons4-overlay.js
Expand Up @@ -30,14 +30,19 @@ var _gDragDrop_onDrop_Orig = gDragDrop.onDrop;
gDragDrop.onDrop = function GM_onDrop(aEvent) {
var urls = droppedUrls(aEvent);

var droppedNonUserScript = false;
for (var i = urls.length - 1, url = null; url = urls[i]; i--) {
if (url.match(/\.user\.js$/)) {
GM_util.showInstallDialog(
url, GM_util.getBrowserWindow().gBrowser, GM_util.getService());
} else {
droppedNonUserScript = true;
}
}

_gDragDrop_onDrop_Orig(aEvent);
// Pass call through to the original handler, if any non-user-script
// was part of this drop action.
if (droppedNonUserScript) _gDragDrop_onDrop_Orig(aEvent);
};

// Set up an "observer" on the config, to keep the displayed items up to date
Expand Down

0 comments on commit 819117a

Please sign in to comment.