Open Selected Link Bookmarklet

/ Published in: JavaScript
Save to your folder(s)

When there's a URL on a page that's not a link, just highlight it and click this bookmarklet. The URL will open in a new window.

If there are multiple selections (e.g., if you've selected something in each of two frames on the page), they will each be opened in a new window.

[Open Link](javascript:(function(){function T(f){try{if(f.getSelection)return f.getSelection().toString();if(f.document.selection)return f.document.selection.createRange().text}catch(e){}return ""}function A(f){var a=[];var t=T(f);if(t)a.push(t.replace(/^\s+|\s+$/g,""));for(var i=0;i<f.length;i++){a=a.concat(A(f[i]))}return a}var a=A(;for(var i=0;i<a.length;i++){if(!/^https?:\/\//.test(a[i])) a[i]="http://"+a[i];[i])}})() "Drag this into your bookmarks!")

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.