Old Programmer
Old Programmer

Reputation: 554

drag href from IE to desktop

I have two <a> tags , with different HREFs:

<a href="http:\\test.com">http<a>

<a href="test:\\test.test">test<a>

The first one can be dragged out from IE to desktop , while the second one not.

What is the way to solve it?

explorer - IE8

Thanks.

Upvotes: 0

Views: 226

Answers (1)

Spudley
Spudley

Reputation: 168843

When you drag a link from the browser to the desktop, the desktop doesn't just get a link added to it; the process is more complex than that.

The operating system recognises looks at the dragged item, and decides what kind of desktop item to create based on the content of the item being dragged.

It is explicitly programmed to recognise the http:// as a protocol for a web hyperlink that opens in the browser, and thus is it knows that the appropriate kind of desktop object for that is a shortcut icon that loads the browser and passes it the specified URL.

Other kinds of protocol may also be inbuilt into the operating system which would create different kinds of icons when they're dropped onto the desktop.

Obviously test:// protocol is not going to be one of those that the operating system knows about; it won't know what kind of desktop icon to create when it sees it, so it can't create anything.

In this sense, URL protocols are treated in a very similar way to mime types and file extensions by the computer; they are all used to determine what type of file it is and thus what to do with it.

All this is configurable. If you know what you're doing you can add additional protocols to the operating system, and define how the computer should behave when it sees them. This action is generally not done by the end user though; it is typically performed behind the scenes when you install software that uses that file type or protocol.

Upvotes: 2

Related Questions