Closed Bug 712421 Opened 13 years ago Closed 12 years ago

allow pasting a URL in the download manager window to download it

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: Gavin, Assigned: Gavin)

References

Details

Attachments

(1 file, 2 obsolete files)

Apparently Safari has this feature. It seems neat.
Attached patch patch (obsolete) — Splinter Review
This works. There may be an more elegant way to hook into "paste", though.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → gavin.sharp
Attachment #583271 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #583291 - Flags: review?(neil)
Comment on attachment 583291 [details] [diff] [review]
patch

Sorry for the delay in getting around to reviewing this.

>+  try {
>+    trans.getAnyTransferData(type, data, {});
>+    if (flavors.indexOf(type.value) == -1)
Transferables can only ever return flavours that you added to them, so this check is entirely unnecessary.

>+    [url, name] = data.value.QueryInterface(Ci.nsISupportsString).data.split("\n");
>+  } catch (ex) {}
Separate try/catch blocks are preventing you from declaring your variables here (and even I wouldn't use var as a workaround). I don't see any downside to having one catch to rule them all.

>+    <key id="pasteKey"
>+         key="V"
>+         modifiers="accel"
>+         oncommand="pasteHandler();"/>
I can't remember whether this will conflict with the search textbox (I assume here that you want Accel+V to have its usual effect there) and SeaMonkey's download manager uses a proper command controller which definitely won't conflict with the textbox so I can give you f+ but not r+.
Attachment #583291 - Flags: review?(neil) → feedback+
Attached patch patchSplinter Review
I tested - the <key> doesn't interfere with pasting in the text box.
Attachment #583291 - Attachment is obsolete: true
Attachment #588184 - Flags: review?(neil)
Attachment #588184 - Flags: review?(neil) → review+
https://hg.mozilla.org/mozilla-central/rev/546e69d2fe66
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
*ROFL*
See Bug 506881, 3-year duplicate closed as WONTFIX.
Anyway this 'trick' is practical, great to see it added.

Just a question: 
- pasting an URL in the download manager is allowed,
- dragging & dropping an element of a webpage into the download manager is allowed,
Why dragging & dropping directly an URL from the location bar into the download manager is not allowed?

May I fill a bug for that?
(In reply to Loic from comment #8)
> *ROFL*
> See Bug 506881, 3-year duplicate closed as WONTFIX.

These things happen.

> Why dragging & dropping directly an URL from the location bar into the
> download manager is not allowed?
> 
> May I fill a bug for that?

Please do. And if you want to write the patch... :)
(In reply to Paul O'Shannessy [:zpao] from comment #9)
> (In reply to Loic from comment #8)
> > May I fill a bug for that?
> 
> Please do. And if you want to write the patch... :)

Filled Bug 722670.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: