Context menu entries works different

Bug reports and enhancement requests
Post Reply
Infocatcher
Posts: 17
Joined: Fri Mar 02, 2012 4:32 pm

Context menu entries works different

Post by Infocatcher »

FlashGot Link:

Code: Select all

<menuitem id="flashgot-menuitem-it" label="FlashGot Link" accesskey="F" oncommand="gFlashGot.downloadPopupLink()" />
gFlashGot.downloadPopupLink

Code: Select all

function (dmName) {
    const link = this.popupLink;
    return link && this.download([ link], gFlashGotService.OP_ONE, dmName);
  }
gFlashGot.__lookupGetter__("popupLink")

Code: Select all

function () { 
    return this.findLinkAsc(document.popupNode);
  }
(correctly works from page context menu)

Now go to FlashGot Options - General, select any available download manager and check "Shown in context menu":

Code: Select all

<menuitem class="menuitem-iconic flashgot-command-menuitem" label="Download Master Portable" id="flashgot-command-mi-Download_Master_Portable" oncommand="gFlashGot.downloadSel(this.label) || gFlashGot.downloadLink(this.label)" />
gFlashGot.downloadLink

Code: Select all

function (dmName) {
    const link = this.currentLink;
    return link && this.download([ link], gFlashGotService.OP_ONE, dmName);
  }
gFlashGot.__lookupGetter__("currentLink")

Code: Select all

function () { 
    const sel = this.srcWindow.getSelection();
    return !sel.isCollapsed && this._wrapAnchor(sel.anchorNode)
      || this.findLinkAsc(this.hoverElement) || this.findLinkAsc(document.commandDispatcher.focusedElement);
  }
Then open context menu for any link and move mouse over any other link (while menu is opened): will be downloaded hovered link instead of "context" link.
I think, it's better to use something like

Code: Select all

gFlashGot.downloadSel(this.label) || gFlashGot.downloadPopupLink(this.label)
Can be tested here: ftp://ftp.mozilla.org/pub/mozilla.org/f ... win32/xpi/

P.S. [ link] without space triggers antispam blocker.
Mozilla/5.0 (Windows NT 6.1; rv:23.0) Gecko/20100101 Firefox/23.0
Infocatcher
Posts: 17
Joined: Fri Mar 02, 2012 4:32 pm

Re: Context menu entries works different

Post by Infocatcher »

Mozilla/5.0 (Windows NT 6.1; rv:23.0) Gecko/20100101 Firefox/23.0
Post Reply