Closed Bug 1851041 Opened 2 years ago Closed 2 years ago

Drag and drop url to FF creates shortcut in temp

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

Firefox 117
defect

Tracking

()

VERIFIED FIXED
120 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- verified
firefox117 --- wontfix
firefox118 --- wontfix
firefox119 --- wontfix
firefox120 --- verified
firefox121 --- verified

People

(Reporter: rhpuckett3, Assigned: edgar)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0

Steps to reproduce:

Dragged URL from Thunderbird message (and Chrome tab) and dropped into Firefox, both in normal/private modes, on Windows 10.

Actual results:

Internet shortcut created in user's Temp folder with name similar to link text. Note:s Shortcuts not removed when FF exits; shortcuts not created if URL's pasted into address bar.

Two examples:
(1) Dropped from TB: https://apple.news/A7kzsgHAEQBu6qf_YQB_HBw
Created shortcuts:
https __apple.news_A7kzsgHAEQBu6qf_YQB_HBw-1.url
https __apple.news_A7kzsgHAEQBu6qf_YQB_HBw-2.url
https __apple.news_A7kzsgHAEQBu6qf_YQB_HBw.url

(2) Dropped from Chrome: https://www.nationalgeographic.com/animals/article/wildlife-watch-news-tuskless-elephants-behavior-change
Created shortcuts:
Under poaching pressure, elephants are evolving to lose their tusks-1.url
Under poaching pressure, elephants are evolving to lose their tusks-2.url
Under poaching pressure, elephants are evolving to lose their tusks.url

Expected results:

Did not expect shortcuts to be created and/or if they were supposed to be, expected them to be removed when FF exited.

(In reply to Rick Puckett from comment #0)

(2) Dropped from Chrome: https://www.nationalgeographic.com/animals/article/wildlife-watch-news-tuskless-elephants-behavior-change
Created shortcuts:
Under poaching pressure, elephants are evolving to lose their tusks-1.url
Under poaching pressure, elephants are evolving to lose their tusks-2.url
Under poaching pressure, elephants are evolving to lose their tusks.url

Note: Page text for URL in example 2 was: "Under poaching pressure, elephants are evolving to lose their tusks"
See second screenshot showing: (Learn more: Under poaching pressure, elephants are evolving to lose their tusks)

Note: Also experienced issue in new profile w/o any add-ons installed.

The Bugbug bot thinks this bug should belong to the 'Core::Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking
Product: Firefox → Core

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d65395a2bd805a5e66ffe91ef622c195c7a652bb&tochange=a4b80c7849febd8d072b4cebfa30606f849877c8

STR:

  1. Open Firefox 116
  2. Open a web page with link
  3. Open Nightly
  4. Drag and drop the link of step 2 to Nightly
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Networking → DOM: Copy & Paste and Drag & Drop

:marco.spiess, since you are the author of the regressor, bug 580928, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(marco.spiess)

I am not sure about the availability of :marco.spiess, therefore I am asking needinfo from Edgar as well.

Flags: needinfo?(echen)

I can reproduce the issue.

Assignee: nobody → echen
Flags: needinfo?(marco.spiess)
Flags: needinfo?(echen)
Severity: -- → S3

When dragging a link, most applications also add file flavors to the drop list on Windows (IIUC, this is to enable Windows to create an internet shortcut, for example, when dragging a link to the Windows desktop). We didn't handle that file format at all, so didn't have this issue. We might need to filter out the file flavors if we see the url flavor is in the drop list.

Setting 118/119 to wontfix. It's an S3 and the regressor shipped in Fx113.
The attached patches don't look like something we would want to uplift for Fx119 beta.

Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7c7228999e18 Part 1: Clean up nsDragService::IsDataFlavorSupported; r=win-reviewers,gstoll https://hg.mozilla.org/integration/autoland/rev/f6e5e427d8e8 Part 2: Add some log in DragService for debugging; r=rkraesig,win-reviewers https://hg.mozilla.org/integration/autoland/rev/5cb270a4e6b6 Part 3: Ignore `CFSTR_FILEDESCRIPTOR*` if `text/x-moz-url` is present; r=rkraesig,win-reviewers

Backed out for causing bustage on nsClipboard.cpp

[task 2023-10-05T20:42:59.612Z] 20:42:59     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang-cl -fms-compatibility-version=19.29 -Xclang -std=c++17 -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml -FonsClipboard.obj -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -guard:cf -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DMOZ_UNICODE '-DMOZ_APP_NAME="firefox"' '-DMOZ_TOAST_APP_NAME="Firefox"' -DMOZ_ENABLE_D3D10_LAYER -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/widget/windows -I/builds/worker/workspace/obj-build/widget/windows -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/gfx/cairo/cairo/src -I/builds/worker/checkouts/gecko/layout/forms -I/builds/worker/checkouts/gecko/layout/generic -I/builds/worker/checkouts/gecko/layout/style -I/builds/worker/checkouts/gecko/layout/xul -I/builds/worker/checkouts/gecko/toolkit/xre -I/builds/worker/checkouts/gecko/widget -I/builds/worker/checkouts/gecko/widget/headless -I/builds/worker/checkouts/gecko/xpcom/base -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -MD -FI /builds/worker/workspace/obj-build/mozilla-config.h -DMOZILLA_CLIENT -fcrash-diagnostics-dir=/builds/worker/artifacts -TP -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -Gy -Zc:inline -Gw -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -Werror -W3 -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wenum-float-conversion -Wvolatile -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-microsoft-exception-spec -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -fno-strict-aliasing -Xclang -ffp-contract=off  -Xclang -MP -Xclang -dependency-file -Xclang .deps/nsClipboard.obj.pp -Xclang -MT -Xclang nsClipboard.obj   /builds/worker/checkouts/gecko/widget/windows/nsClipboard.cpp
[task 2023-10-05T20:42:59.612Z] 20:42:59    ERROR -  /builds/worker/checkouts/gecko/widget/windows/nsClipboard.cpp(1330,11): error: use of undeclared identifier 'WinUtils'
[task 2023-10-05T20:42:59.612Z] 20:42:59     INFO -   1330 |           WinUtils::GetClipboardFormatAsString(fEtc.cfFormat, format);
[task 2023-10-05T20:42:59.612Z] 20:42:59     INFO -        |           ^
[task 2023-10-05T20:42:59.612Z] 20:42:59     INFO -  1 error generated.
[task 2023-10-05T20:42:59.612Z] 20:42:59    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:660: nsClipboard.obj] Error 1
Flags: needinfo?(echen)
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6e0771104db1 Part 1: Clean up nsDragService::IsDataFlavorSupported; r=win-reviewers,gstoll https://hg.mozilla.org/integration/autoland/rev/da2728cfb0d4 Part 2: Add some log in DragService for debugging; r=rkraesig,win-reviewers
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fff9a9d844be Part 3: Ignore `CFSTR_FILEDESCRIPTOR*` if `text/x-moz-url` is present; r=rkraesig,win-reviewers
QA Whiteboard: [qa-120b-p2]

Seems like we might want to take this on ESR115 also due to the privacy implications. Please nominate if you agree.

Flags: needinfo?(echen)

Yes, I think it is worth uplifting, but only part 3 is required. I will prepare a backport patch for ESR115.

Attachment #9361171 - Flags: approval-mozilla-esr115?

Uplift Approval Request

  • Explanation of risk level: This patch only ignore virtual file format when virtual file and url format are both present in system clipboard, change should be safe.
  • Risk associated with taking this patch: Low
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: follow the steps in https://bugzilla.mozilla.org/show_bug.cgi?id=1851041#c5
  • String changes made/needed: None
  • Is Android affected?: no
  • User impact if declined: A empty temporary file with url as file name is created when dropped a link from another FF window or other browsers
  • Code covered by automated testing: no
Flags: qe-verify+
Flags: needinfo?(echen)

Comment on attachment 9361171 [details]
Bug 1851041 - Ignore CFSTR_FILEDESCRIPTOR* if text/x-moz-url is present;

Approved for 115.5esr

Attachment #9361171 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
QA Whiteboard: [qa-120b-p2] → [qa-120b-p2][qa-triaged]

I was able to reproduce the issue on Win10x64 using Firefox build 119.0a1(2023-08-31). Could not reproduce on Mac/Ubuntu22.04.
Verified as fixed on Win10x64 using Firefox builds 120.0b4, 121.0a1(2023-11-01) and 115.5.0esr(20231031141329)-from Treeherder.

Waiting for official 115.5.0esr build to complete the verification.

Verified issue as fixed on Win10x64 using Firefox build 115.5.0esr.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: