Microsoft Edge Copy Title and URL of a Web Page [Bookmarklet]

There are several third-party extensions out there to copy webpage title and address, for browsers like Chrome, Firefox and others. Here is a neat trick to add your own Copy Title & URL bookmarklet for Microsoft Edge.

Copy Title and URL Bookmarklet for Microsoft Edge

In Microsoft Edge (Chromium), create a bookmark to a sample site.

Then replace (edit) the URL of the bookmark with the following target:

javascript:(function() { function copyToClipboard(text) { if (window.clipboardData && window.clipboardData.setData) { /*IE specific code path to prevent textarea being shown while dialog is visible.*/ return clipboardData.setData("Text", text); } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { var textarea = document.createElement("textarea"); textarea.textContent = text; textarea.style.position = "fixed"; /* Prevent scrolling to bottom of page in MS Edge.*/ document.body.appendChild(textarea); textarea.select(); try { return document.execCommand("copy"); /* Security exception may be thrown by some browsers.*/ } catch (ex) { console.warn("Copy to clipboard failed.", ex); return false; } finally { document.body.removeChild(textarea); } } } var markdown = document.title + ':' + '\r\n' + window.location.href; copyToClipboard(markdown); })();

microsoft edge chromium - copy title and url

Visit a website and click on the bookmarklet. It will copy the title and the URL of the current webpage, in the following format:

Microsoft Edge Copy Title and URL of a Web Page [Bookmarklet] » Winhelponline:
https://www.winhelponline.com/blog/edge-copy-title-url-web-page-bookmarklet/

Credits to bradleybossard/titleUrlMarkdownClip.js — Bookmarklet to copy current page title and url

The above javascript code also works on Google Chrome, Firefox, and other browsers.

Instructions for the old Microsoft Edge

Open Microsoft Edge, visit a website, and add it to the Favorites bar. Name the favorite as Copy Title & URL, or anything as you’d like.

edge copy title and url bookmarklet

Now, we’ll change that favorite’s target to a javascript code, which copies the page title and URL of the current tab. As of Windows 10 Fall Creators Update you can edit the URL of an existing bookmark in Edge. To do that, right-click on the bookmark and click Edit URL. Type in the following javascript code and press ENTER:

javascript:window.prompt("Copy Title & URL",document.title + " : " + location.href);void(0);

The above javascript code gets the title and website address of the current webpage and shows it in a text box which you need to copy (CTRL + C)



Start Microsoft Edge, visit a website, and then click the Copy Title & URL bookmarklet you created.

edge copy title and url bookmarklet

You’ll be shown the following prompt with a text control box, showing the title, which is followed by the URL of the webpage. The text range is automatically selected for you.

edge copy title and url bookmarklet

Due to security restrictions in the old Microsoft Edge web browser, javascript can’t copy stuff to the clipboard directly without the user’s consent, and hence the additional prompt above. Likewise, a new line or carriage return doesn’t seem to work in Edge. So the title and URL will be outputted in a single line as below:

Lifehacker - Tips and downloads for getting things done : http://lifehacker.com/

All you need to do is press Ctrl + C to copy the text to the clipboard and dismiss the dialog by clicking OK or pressing the ESC key.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

Leave a Comment