Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Drag'n' drop into AOM (two install dialogs), Private Browsing: The icon (enabled/disabled) #1789

Closed
wants to merge 6 commits into from

2 participants

@Ventero

Your patch for drag & drop fails when the user drops a userscript as well as a normal addon (or any other non-userscript file) onto the addons manager at the same time (no install dialog is displayed in that case, since the original handler is called, which calls .preventDefault() on the event, thus preventing the call to service#shouldLoad).

Instead, the issue can be properly fixed by simply calling aEvent.preventDefault(); at the end of GM's gDragDrop.onDrop.

Edit: See also #1663 for a discussion on why all of this is necessary.

@janekptacijarabaci

You are right, thank you. Please still correct me if I am wrong :-)

janekptacijarabaci Private Browsing: Click on the icon (+ popup menu: Enabled)
... and the icon will not change
0d693d9
@janekptacijarabaci janekptacijarabaci changed the title from Drag'n' drop into AOM (two install dialogs), Greasemonkey = disabled (button "Install Script" not works), Private Browsing: The icon (enabled/disabled), GM_getResourceText: if missing resource name, Editing a script - an old bug is back again to Drag'n' drop into AOM (two install dialogs), Greasemonkey = disabled (button "Install Script" not works), Private Browsing: The icon (enabled/disabled)
@janekptacijarabaci janekptacijarabaci changed the title from Drag'n' drop into AOM (two install dialogs), Greasemonkey = disabled (button "Install Script" not works), Private Browsing: The icon (enabled/disabled) to Drag'n' drop into AOM (two install dialogs), Private Browsing: The icon (enabled/disabled)
@janekptacijarabaci

New Issue / Pull Request: #1980

@janekptacijarabaci janekptacijarabaci deleted the janekptacijarabaci:patch-2 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 15, 2013
  1. Greasemonkey = disabled, drag-n-drop into browser, button "Install Sc…

    janekptacijarabaci authored
    …ript" not works
Commits on Aug 16, 2013
Commits on Aug 18, 2013
  1. Private Browsing: Click on the icon (+ popup menu: Enabled)

    janekptacijarabaci authored
    ... and the icon will not change
Commits on Sep 1, 2013
  1. GM_getResourceText throws unexpected and unhelpful error on missing r…

    janekptacijarabaci authored
    …esource name
    
    Ad greasemonkey#1796
Commits on Sep 12, 2013
  1. Editing a script - an old bug is back again

    janekptacijarabaci authored
This page is out of date. Refresh to see the latest.
View
8 content/addons4-overlay.js
@@ -48,7 +48,12 @@ gDragDrop.onDrop = function GM_onDrop(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);
+ if (droppedNonUserScript) {
+ _gDragDrop_onDrop_Orig(aEvent);
+ }
+ else {
+ aEvent.preventDefault();
+ }
};
// Set up an "observer" on the config, to keep the displayed items up to date
@@ -72,6 +77,7 @@ var observer = {
if (!data) break;
var oldAddon = ScriptAddonFactoryByScript({'id': data});
if (!oldAddon) break;
+ addon = ScriptAddonFactoryByScript(script, true);
// Use old and new the addon references to update the view.
var item = createItem(addon);
View
2  content/browser.js
@@ -254,7 +254,7 @@ GM_BrowserUI.checkDisabledScriptNavigation = function(aEvent, aSafeWin, aHref) {
'accessKey': GM_BrowserUI.bundle.GetStringFromName('disabledWarning.install.accessKey'),
'popup': null,
'callback': GM_util.hitch(this, function() {
- GM_util.showInstallDialog(this, aTabBrowser, GM_util.getService());
+ GM_util.showInstallDialog(aHref, gBrowser, GM_util.getService());
})
}]
);
View
4 content/browser.xul
@@ -12,9 +12,9 @@
<commandset>
<!-- sync the 'disabled' attribute for toolbar button -->
- <command id="gm_toggle_enabled" oncommand="GM_util.setEnabled(!GM_util.getEnabled());"/>
+ <command id="gm_toggle_enabled" oncommand="GM_util.setEnabled(!GM_util.getEnabled()); GM_BrowserUI.refreshStatus();"/>
<!-- sync the 'checked' attribute for menu items -->
- <command id="gm_toggle_checked" oncommand="GM_util.setEnabled(!GM_util.getEnabled());"/>
+ <command id="gm_toggle_checked" oncommand="GM_util.setEnabled(!GM_util.getEnabled()); GM_BrowserUI.refreshStatus();"/>
</commandset>
<toolbarpalette id='BrowserToolbarPalette'>
View
4 content/miscapis.js
@@ -51,6 +51,10 @@ GM_ScriptStorage.prototype.listValues = function() {
function GM_Resources(script){
this.script = script;
+ this.stringBundle = Components
+ .classes["@mozilla.org/intl/stringbundle;1"]
+ .getService(Components.interfaces.nsIStringBundleService)
+ .createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
}
GM_Resources.prototype.getResourceURL = function(aScript, name) {
Something went wrong with that request. Please try again.