Avram Grumer ([info]agrumer) wrote,
@ 2009-05-07 04:58:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:computers, firefox, mac

Getting rid of target="_blank"

OK, found a way to keep links from opening new windows in Safari. Here it is:

Step 1: Install GreaseKit. (GreaseKit is the Safari port of Greasemonkey, a Firefox add-on that lets you run arbitrary JavaScript code to modify web pages as they download.)

Step 2: Install _blank Must Die, a userscript that strips the target="_blank" attributes out of link tags.

Step 3: Quit and relaunch Safari.

Step 4: Sigh with relief when Twitter links no longer spawn new windows.

Note for Firefox users: That userscript in Step 2 ought to work for you as well, but you don’t need to bother, since you’ve got some useful features baked right into your browser, no add-ons required.

Microsoft Internet Explorer users, I dunno. If you guys cared about your web experience, you wouldn’t be using MSIE.

Update: Just discovered that the GreaseKit _blank Must Die hack will mess up Google Calendar. The fix is to disable the hack for Google, like so:

  1. In Safari, from the GreaseKit menu, choose “Manage Scripts…”
  2. In the Manage Scripts dialog, select “_blank Must Die” from the list on the left of the box. (Don’t turn the check-box off, just click the name “_blank Must Die” to select it.)
  3. See the “Exclude” box? Click the “Add” button next to it.
  4. In that new line that was just created in the Exclude box, type:
    *.google.com/*
  5. Close the Manage Scripts box. Maybe you need to quit and restart Safari, too.



(12 comments) - (Post a new comment)


[info]mister_wolf
2009-05-07 12:25 pm UTC (link)
What, so people don't like target=_blank? I guess I can just ctrl-click, but I'm not always done with the page I was reading when I click a link

(Reply to this) (Thread)


[info]ckd
2009-05-07 02:22 pm UTC (link)
I hate it. If I want to open a link in a new window or tab, I'll do it. I can just middle-click in most browsers, so it's not even like it's any more work.

(Reply to this) (Parent)


[info]redbird
2009-05-07 04:58 pm UTC (link)
That's right, people don't like it. Especially early in the morning, I don't like discovering that "back" doesn't work and I need to close the new tab by hand, or use the mouse to get back where I was.

(Reply to this) (Parent)


[info]agrumer
2009-05-07 09:53 pm UTC (link)
Without target=_blank: Clicking a link loads in the current tab; Command-click (control-click for Windows and Linux peeps) loads in a new tab. Command-option-click loads in a new window, which I almost never do, but the option's there for me. My choice.

With target=_blank: Clicking spawns a new fucking window, which is pretty much never what I want. Right-clicking brings up a menu that lets me load in a new tab, but I can't just load in the current window if I do happen to be done with what I'm currently looking at. So one option is gone, another requires more work, and the default option is the one I like least.

(Reply to this) (Parent)


[info]mcroft
2009-05-07 05:23 pm UTC (link)
... I'd like this, but almost every instance I know of where someone has had their system scrod by an Apple System update, the culprit has been SIMBL, or something installed via SIMBL.

(Reply to this) (Thread)


[info]agrumer
2009-05-07 09:45 pm UTC (link)
Understandable. I've been using SIMBL extensions for years, though, and never had a problem along those lines.

(Reply to this) (Parent)


[info]burger_eater
2009-05-07 05:45 pm UTC (link)
Safari has extensions?

(Reply to this) (Thread)


[info]agrumer
2009-05-07 09:46 pm UTC (link)
Hell yeah it does.

(Reply to this) (Parent)(Thread)


[info]burger_eater
2009-05-08 03:18 pm UTC (link)
Thank you!

(Reply to this) (Parent)


[info]stormsweeper
2009-05-08 03:54 am UTC (link)
If you're not on a too small screen and want to avoid extensions, you can click and drag the link into the location bar.

(Reply to this) (Thread)


[info]stormsweeper
2009-05-08 03:54 am UTC (link)
too large screen, I mean.

(Reply to this) (Parent)

unable to install GreaseKit
(Anonymous)
2009-12-14 07:00 am UTC (link)
I followed the steps to install GreaseKit as noted in 'http://8-p.info/greasekit/'. But on restarting Safari, I don't see the GreaseKit menu added.
I verified that SIMBL installation did create the 'SIMBL.bundle' file under'/Library/InputManagers/SIMBL/'.
Stuck here. Any help appreciated.

(Reply to this)


(12 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…