Linkify ting (exclude emails)

By JoeSimmons Last update Jun 2, 2010 — Installed 5,071 times.

Tweak to Open Links in new Window

in
Subscribe to Tweak to Open Links in new Window 4 posts, 2 voices



KJH User
FirefoxWindows

While a totally minor feature addition, I wished this script had the option to open links in new windows. Since I can be one of those 'impatient' computer users, I decided to just hack a solution together myself. Turned out to be just a 1-line addition, so I thought I would share. Oh, this is an all-or-nothing solution - so once you modify the script (a la moi), it always opens links in new windows!

Here it is. Head into the Greasemonkey options, select LinkifyTing and click Edit.
Look for this line in the script (towards the bottom):

a.setAttribute('href', href); //giv det en href

Then add this line right after it:

a.setAttribute("target", "new");

That's it. Save it, and you should be good to go.

HTH!

_Khalid

 
JoeSimmons Script's Author
FirefoxWindows
KJH wrote:
a.setAttribute("target", "new");
Actually it's a.setAttribute("target", "_blank")
I edited it anyways.
 
KJH User
FirefoxWindows

Yup, Joe is right. Thanks Joe.

I should have noted that I wanted the links opening in the 'same' new window all the time, which is why I gave it a name "new". You could call it "blah" if you'd like!

 
JoeSimmons Script's Author
FirefoxWindows

I see. Changed.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel