Copy as HTML Link for Firefox
Here’s the scenario
You’re blogging. WordPress, Movable Type, Blogger, it doesn’t matter. You’ve got like 15 to 20 tabs open in Firefox. As per usual.
You’ve just stumbled upon the best quote on some blog that’s like totally supportive of whatever you’re blogging about. So you copy the URL and flip back to your post, only to experience this unsettling cognitive race condition.
Since you’ve yet to copy the actual text of the quote into your post,
you can’t use your blog’s “create a link” button (some popular examples to the right). But at the same time, you can’t go back and copy the text without losing the URL. Errr.
Have you heard the one about the farmer trying to get a wolf, a sheep, and a cabbage across the river?
So what happens?
As a workaround, you paste the URL into your post, flip back to the post you got the URL from, copy the text you meant to excerpt, flip back to your blog (trying to find the right tab), paste the text, cut the URL out of your post, select the copied text, click the “create a link” button, and finally paste the URL into the JavaScript popup where you’d originally intended.
All that for a link! Two words: usability nightmare.
Even if things had happened in the right order—select text, copy text, switch tabs, paste text, switch tabs, copy URL, switch tabs, select text, click “create a link” button, paste URL—copying a simple quote and its URL from a webpage still requires 10 tedious, error-prone, and redundant steps.
So what should happen?
I want to be able to copy a quote and its URL at the same time, without having to so much as think about it. To do so, I wrote my first Firefox extension, which I opted to name the somewhat homely, Copy as HTML Link.
I took Jeremy Gillick’s Copy Plain Text plugin and modified it (with permission) to build an HTML link out of whatever text is selected, containing both the text and its URL. The idea was so simple, I can’t believe I didn’t think of it earlier. I also looked at Jedrick Kostecki’s excellent imgTag extension for inspiration, which does the same for <img /> tags when you right click on an image.
So if you were to use Copy as HTML Link to copy the first line of this paragraph, and then you pasted that into your blog post or text editor, you’d get:
<a href="http://justinsomnia.org/2006/05/copy-as-html-link-for-firefox/">I want to be able to copy a quote and its URL at the same time</a>
How to use Copy as HTML Link
Here’s a visual explanation of how it works:

What was 10 steps becomes 4: Select text, right click and select Copy as HTML Link, switch tabs, paste link.
Bonus step 5: continue blogging, train of thought intact.
Get Copy as HTML Link for Firefox
Update: you can now download this extension from addons.mozilla.org: Get Copy as HTML Link.
if you’d like to install the extension directly from me, feel free to install Copy as HTML Link by clicking this link (updated for Firefox 2.0 3.0!). The first time you click that link, you’ll have to manually allow extension installations from justinsomnia.org by clicking “Edit Options” in the upper right, clicking “Allow”, and then clicking the install link again. After it installs, just restart Firefox and you’ll be good to go.
Update: Brian Layman has created a version of Copy as HTML Link and imgTag for Internet Explorer. Excellent.


Absolutely Brilliant! Thank you!
How about Copy IMAGE as Link?