Closed Bug 341057 Opened 18 years ago Closed 11 years ago

Drag&drop of text to Download button does nothing

Categories

(Firefox :: Toolbars and Customization, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: thephilips, Unassigned)

Details

(Keywords: polish)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4

Tab bar when text is dropped onto it does perform check to see whehther the test looks like URL and if it is, it does open it in (new) tab. The same works for location bar.

But that doesn't work, when DnD text onto Downloads button. DnDing URL opens Download manager and starts download of DnDed URL. But DnDing of text does nothing.

Reproducible: Always

Steps to Reproduce:
1. (Skip the step if Downloads button is already in toolbar) right click on toolbar and select customize. DnD "Downloads" button anywhere on toolbar. Close Customize sheet.
2. Open any page. DnD any link from it on "Downloads" button. Notice it works.
3. Open any page. DnD any link from it on Tab bar. Notice it works.
4. Open page with inlined URL. Select URL and DnD it on tab bar. Notice it works.
5. Open page with inlined URL. Select URL and DnD it into location bar. Notice it works.
6. Open page with inlined URL. Select URL and DnD it onto "Downloads" button. Notice it does NOT work.
Actual Results:  
In step 6 nothing happens.

Expected Results:  
Download manager starts downloading the URL.

P.S. Ironicaly, since there is no workaround for the problem (impossible to download inlined link/plain text URL, see bug 62253, (dup) bug 326649, etc) i have to keep the problem at "normal" severity :-/
Looks like a valid request to me. It should be possible to modify the onDrop event of DownloadsButtonDNDObserver to do this.
Status: UNCONFIRMED → NEW
Ever confirmed: true
What shall I do to try that change on 1.5.x?

My understaning was:
 (1) unpack chrome/browser.jar/content/browser to chrome
 (2) patch browser/browser.js

Is that sufficient?
The easiest way to test this patch without jumping through hoops would be to install the userChrome.js extension (see http://forums.mozillazine.org/viewtopic.php?t=397735 ) and then add the following code to the new userChrome.js file in your profile's chrome folder:

DownloadsButtonDNDObserver.onDrop = function(aEvent, aXferData, aDragSession) {
  // same way to get a valid URL as used by tabbrowser::onDrop
  var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType);
  if (!url || url.indexOf(" ", 0) != -1 || /^(javascript|data):/.test(url))
    return;

  getBrowser().dragDropSecurityCheck(aEvent, aDragSession, url);

  var filename = aXferData.data.split("\n")[1] || null;
  saveURL(url, filename, null, true, true);
};

Of course, unpacking browser.jar, applying the patch and repacking browser.jar would also work.
It works with the userChrome.js hack. So I expect it to work with attached patch.
Attachment #225130 - Flags: review?(mconnor) → review?(gavin.sharp)
Status: NEW → ASSIGNED
Keywords: polish
OS: Windows XP → All
Hardware: PC → All
Assignee: nobody → zeniko
Status: ASSIGNED → NEW
Comment on attachment 225130 [details] [diff] [review]
get the URL in the same way as the tabbrowser

The Bookmarks, New Tab, New Window and Go buttons don't correctly get the URL from the dropped object, either. Canceling this request until a more general solution has been considered.
Attachment #225130 - Flags: review?(gavin.sharp)
Assignee: zeniko → nobody
Component: Download Manager → Toolbars
QA Contact: download.manager → toolbars
> Canceling this request until a more general solution has been considered.

As it was highlighted in other bug, Download Manager button is more /critical/ than others.

I have found the defect when I was trying to find a way to download file from URL which was part of text on page. All you can do with such "text" is to copy it to clipboard or drag&drop.

One can easily fed an URL e.g. from clipboard to Boormarks or New Tab/Window. But there is no easy way for a Download Manager since it doesn't support any way for user to give it an URL - nor by drag&drop of text nor from clipboard.

Though I would agree that it is hardly an argument ;)
This appears to have been fixed - I believe it was taken care of as part of the Downloads Panel work in bug 564934.
Status: NEW → RESOLVED
Closed: 11 years ago
Depends on: DownloadsPanel
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
This works in Firefox 19 without the download panel activated.
No longer depends on: DownloadsPanel
Resolution: FIXED → WORKSFORME
Target Milestone: Firefox 20 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: