Closed Bug 794410 Opened 10 years ago Closed 10 years ago

Drag and dropping an about: tab (e.g. about:newtab, about:config, etc.) to the download button downloads the associated XUL file

Categories

(Firefox :: Downloads Panel, defect)

x86_64
Windows 7
defect
Not set
trivial

Tracking

()

VERIFIED FIXED
Firefox 23
Tracking Status
firefox23 --- verified
firefox24 --- verified

People

(Reporter: smrank, Assigned: Cykesiopka)

Details

Attachments

(1 file, 1 obsolete file)

Drag and dropping an about: tab (e.g. about:newtab, about:config, etc.) to the download button downloads the associated XUL file.

Steps to reproduce:
1. Open a new blank tab.
2. Drag the new tab and drop on the downloads button.

A XUL file is downloaded to the Downloads directory.
This doesn't happen dragging to the old manager, and doesn't sound like a particularly useful feature to keep.
Attached patch Proposed Patch (obsolete) — Splinter Review
Pasting an about: tab into the downloads popup also seems to suffer the same problem... But maybe for another bug?
Attachment #734204 - Flags: review?(paolo.mozmail)
Comment on attachment 734204 [details] [diff] [review]
Proposed Patch

>@@ -533,16 +533,20 @@ const DownloadsIndicatorView = {
>     // If dragged item is from our source, do not try to
>     // redownload already downloaded file.
>     if (dt.mozGetDataAt("application/x-moz-file", 0))
>       return;
> 
>     let name = {};
>     let url = browserDragAndDrop.drop(aEvent, name);
>     if (url) {
>+      if (url.indexOf("about:") == 0) {
>+          return;
>+      }

Indentation is off.
You can use url.startsWith(...) instead of url.indexOf(...) == 0.
(In reply to Dão Gottwald [:dao] from comment #4)
> Comment on attachment 734204 [details] [diff] [review]
> Proposed Patch
> 
> >@@ -533,16 +533,20 @@ const DownloadsIndicatorView = {
> >     // If dragged item is from our source, do not try to
> >     // redownload already downloaded file.
> >     if (dt.mozGetDataAt("application/x-moz-file", 0))
> >       return;
> > 
> >     let name = {};
> >     let url = browserDragAndDrop.drop(aEvent, name);
> >     if (url) {
> >+      if (url.indexOf("about:") == 0) {
> >+          return;
> >+      }
> 
> Indentation is off.
> You can use url.startsWith(...) instead of url.indexOf(...) == 0.

Ah, thanks!
Fixes indentation and uses startsWith()
Attachment #734204 - Attachment is obsolete: true
Attachment #734204 - Flags: review?(paolo.mozmail)
Attachment #734298 - Flags: review?(paolo.mozmail)
Comment on attachment 734298 [details] [diff] [review]
Proposed Patch v2

Review of attachment 734298 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch!
Attachment #734298 - Flags: review?(paolo.mozmail) → review+
(In reply to Paolo Amadini [:paolo] from comment #7)
> Thanks for the patch!

No problem!
Assignee: nobody → cykesiopka
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c2ce06b2fa04
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20130421 Firefox/23.0

Verified as fixed on Firefox latest nightly (Build ID:	20130421031002).
Verified as fixed also on latest Nightly 24.0, on Windows 7, 64 bits.

- User agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:24.0) Gecko/20130519 Firefox/24.0, Build ID: 20130519031035
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.