Closed Bug 309113 Opened 19 years ago Closed 18 years ago

Clipboard format UniformResourceLocator should be optional when copying text

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 315370

People

(Reporter: dsmutil, Assigned: jag+mozilla)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050917 SeaMonkey/1.1a
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050917 SeaMonkey/1.1a

I'll open this as unconfirmed since this very well could be a duplicate (but I
can't find one)....


When copying text from a web page, the clipboard format UniformResourceLocator
is defined, even if a URL isn't being copied (it's set to the URL of the source
page). The problem is that some programs (e.g., Microsoft Outlook) assume an
"Internet Shortcut" is being copied if this is set, so it creates the shortcut
instead of using the desired data. While this is more a bug in those other
programs, giving them the data they expect can reduce frustration.

Workaround: paste text into another program and then re-copy it.


Reproducible: Always

Steps to Reproduce:
1. In Mozilla/Seamonkey (but not Firefox), go to any web page and copy some text.
2. Create a new PLAIN TEXT message in Outlook
3. Paste text into body of message

Actual Results:  
Outlook creates a URL shortcut attachment. (It DOES work if the mail message is
HTML.)

Expected Results:  
When the URL isn't included, Outlook uses the correct form.

Mozilla/SeaMonkey sets the following formats:
Unicode Text
Text
Locale
OEM Text
DataObject
text/html
HTML Format
text/_moz_htmlcontent
text/_moz_htmlinfo
FileGroupDescriptor
FileGroupDescriptorW
FileContents
UniformResourceLocator
UniformResourceLocatorW
Ole Private Data

While Firefox sets:
Unicode Text
Text
Locale
OEM Text
DataObject
text/html
HTML Format
text/_moz_htmlcontent
text/_moz_htmlinfo
Ole Private Data

Firefox works correctly because it doesn't include the URL.
This is definitely a bug in Firefox and not the other programs.

When a Windows program puts data into the clipboard in multiple formats, each item (format) should be different representations of the SAME data. Firefox is putting meta-data (the URL) into the clipboard along with what you've copied (the text) but there is no way for the program you paste into to know which format of data the user intended to copy.

The only reason for putting multiple formats of data into the clipboard is so that programs which don't understand one format (e.g. HTML or rich text) can still paste a more simple version of the data (e.g. plain text). It is absolutely not for meta-data.

This bug that was introduced in FF 1.5 is really annoying me. The file manager I use (Directory Opus) allows you to Ctrl-V into its window to paste the contents of the clipboard into a new text or image file (if those formats are in the clipboard). But Opus also understands the URL clipboard format and, if that is present, pastes a URL file instead.

It's not Opus's fault because it absolutely makes sense to choose URL format data over plain text format. If a program puts a URL in the clipboard then it makes sense to store it both as URL format and as a plain-text version for programs that don't understand the URL format (which I presume has some extra data). What does not make sense is a program putting selected text from a webpage into the clipboard in several formats and then also adding the URL to the clipboard in URL format. That's plain wrong.
(In reply to comment #1)
> This is definitely a bug in Firefox and not the other programs.

To clarify, Firefox 1.5 seems to have adopted the (incorrect) Mozilla/SeaMonkey behaviour that you documented above. I meant that it's a bug in Firefox (and Mozilla I guess) rather than a bug in the programs that you paste into (Outlook, Opus, etc.).

The pasted-into programs will correctly paste the most complex format in the clipboard that they understand. They have no way of knowing that the text-format data was actually what the user copied and the URL-format data is actually unwanted meta-data.
I realise this bug precedes 315370, but I'm pretty sure it's the same bug, and that one has a patch now.

-dave

*** This bug has been marked as a duplicate of 315370 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.