Closed Bug 280724 Opened 20 years ago Closed 3 years ago

Internet Shortcut copied to clipboard does not paste as proper URL in HTML Compose window

Categories

(Core :: Widget: Win32, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: lindyboi, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla Thunderbird version 1.0 (20041206)

When an "Internet Shortcut" is copied to the clipboard, a simple "paste" in
Thunderbird pastes the location of the temporary "Internet Shortcut" file
instead of the file contents.

Reproducible: Always

Steps to Reproduce:
1. From iTunes music store, right-click a track and choose "Copy iTunes Music
Store URL"
2. Open a Thunderbird message to send this link to a friend
3. Paste

Actual Results:  
A string like the following appears:
imap://binain@mail.mac.com:143/fetch%3EUID%3E/Sent%20Messages%3E1908?part=1.2&filename=How%20Can%20I%20Apply%20(Performed%20March%2016th,%202004%20On%20KCRW.com).url

Expected Results:  
The actual link should paste in (here I am pasting the same clipboard contents
into the FireFox text editing window)
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playlistId=20478985&selectedItemId=20478983

The temp file at the location in the actual results is an Internet Shortcut,
containing the correct string.
When I paste into FireFox or Internet Explorer address bars, or even the text
area above, the shortcut is dereferenced into its contents rather than the file
name.
If I paste directly into recipient field in the same mail, the proper URL is pasted.
Version: 0.9 → 1.0
(In reply to comment #0)
> Steps to Reproduce:
> 1. From iTunes music store, right-click a track and choose
>    "Copy iTunes Music Store URL"

This is from within the iTunes program.

> 2. Open a Thunderbird message to send this link to a friend

HTML Compose window; the problem doesn't occur with plain-text mail.

> 3. Paste
> 
> Actual Results:  
> A string like the following appears:
> imap://binain@mail.mac.com:143/[...]

I don't see an IMAP: URL.  If I paste into an HTML compose window, I do see a  
file://  URL get pasted in, as a link with an href to the same  file:// URL.

What's happening is:  When you perform the Copy action, iTunes fills the 
clipboard with multiple flavors of the information (viewable via CLIPBRD.EXE):  
Text, Unicode Text, OEM Text (those three are normal for copying text), and 
"Drag-Drop Data" which I presume is what's getting pasted into the HTML compose 
window.  The same paste results are achieved if you paste in to NVu or Mozilla 
Composer.

Pasting into Word yields the same results as pasting into any plain-text edit 
field.  Pasting to the Windows Desktop creates an Internet Shortcut file, whose 
contents are:
  [InternetShortcut]
  URL=http://phobos.apple.com/[...]



(Oddly, perhaps interesting: when I paste into my editor, Codewright [originally 
by the company Premia], the URL appears as plain text -- and the contents of the 
clipboard are changed.  The three Text flavors persist, but the Drag-Drop Data 
flavor is replaced in the Clipbook Viewer menu by a different flavor called 
"PremiaCWClipboardFormat0" -- which is also disabled in the menu, per what 
criterion I do not know.  Subsequent to this, pasting to a Mozilla HTML compose 
window yields the expected, plain-text URL string.)
Status: UNCONFIRMED → NEW
Component: Message Compose Window → Editor
Ever confirmed: true
OS: Windows XP → Windows 2000
Product: Thunderbird → Core
Summary: Internet Shortcut copied to clipboard does not paste as proper URL in message editing window → Internet Shortcut copied to clipboard does not paste as proper URL in HTML Compose window
Version: 1.0 → Trunk
Assignee: mscott → mozeditor
QA Contact: bugzilla
This isn't an editor issue... Sounds like Win32 widgetry stuff (clipboard).
Assignee: mozeditor → win32
Component: Editor → Widget: Win32
QA Contact: bugzilla → ian
Boris: When I paste into a text field (such as this one) in FireFox, or a
browser address bar, or a recipient field, then the current URL is pasted. It is
only when pasting into the mail editor main pane that I see the file:/// link
pasted.
Whiteboard: http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playlistId=20478985&selectedItemId=20478983
Well, normally when you paste a "file" into the editor, you'd want the file
location.

In this case, the file location is useless, because the file is a shortcut. But
editor doesn't know anything about shortcuts -- it just asks the clipboard for a
flavor and gets it.  It's the clipboard's responsibility to make sure that the
data it gives out for a flavor request makes sense for that flavor.
When I paste the same clipboard contents into MS Outlook, it actually attaches
the shortcut, which is then usable to my recipient.

The issue here is that only the filename is pasted.
Functionally acceptable alternatives:
- When a local "file" is pasted, add the file itself to the editor
- When a local "file" is pasted, attempt to add the file's contents - learn what
a windows shortcut is
- Use one of the other flavors from the clipboard that is recognized
Ignore the fact that it's a shortcut.  If a file is pasted into the editor,
what's the reasonable thing to do?  The only reasonable thing to do is to paste
the filename...

Now a shortcut is not really a "file".  But the cross-plaform editor should not
need to know that.  The OS-specific clipboard impl should handle it.
(In reply to comment #7)
> Now a shortcut is not really a "file".  But the cross-plaform editor should
> not need to know that.  The OS-specific clipboard impl should handle it.

As it happens, the (HTML) editor accepts drops of files in a way that is not 
very useful for HTML mail -- that is, it creates an <a> tag.  (There are several 
bugs about this behavior, in particular about using the "file://..." URL string 
as both the link text and the link href.)

Unless: the file is an image.  The editor is smart enough to recognize the image 
and create an <img> tag instead of an <a>.  The editor *could* be smart enough 
to recognize the "internet shortcut" format and parse out the content URL into 
an <a> tag, rather than the worthless file:// URL.

I'm not sure this is 100% Windows, either.  I'm curious how the Mac version of 
iTunes loads up the clipboard when using the "Copy iTunes Music Store URL" 
action on that platform.  Also, Opera handles dragging of URLs by filling the 
Windows clipboard with the same Internet Shortcut data under Windows; Opera also 
runs under OS X *and* Linux, and it would be worth investigating how it does 
this action under those platforms.
Perhaps people are misunderstanding... the "clipboard impl" is the "widget stuff
in Mozilla", not the "stuff the OS implements".   So as long as that does the
Right Thing, the core code can be fully XP and not have to worry about
platform-specific formats.
Works for me in TBird 1.0 OSX, text or HTML compose.
Whiteboard: http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playlistId=20478985&selectedItemId=20478983
Assignee: win32 → nobody
QA Contact: ian → win32

Closing since this is related to "HTML mail compose" and comment 10 indicates that this was working in Thunderbird 1.0.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.