gmail: do all links have to open in a new window?
Despite Gmail fighting Greasemonkey scripts, or locking greasemonkey users away,
I wonder if people would still be willing to write fixes for gmail
usability issues. One problem I noticed is that, not matter what, all
links in all emails open in a new window. This contradicts Adsense,
which is kind of external focused and still succeeded in not
implementing a setting for opening links in a new window after so many
years.
Updated: after a short research, I found that such a Greasemonkey script already exists: "remove the javascript call that opens a new window for links in messages in Gmail" (src here). Btw, did I say that Greasemonkey rocks? But since the recent gmail change, this fix doesn't work anymore. Google seems to have fun fighting with the firefox js community. Anyway, I mailed the creator of the script the fixed version, hopefully he will put it live fast. Until he does it, here's the fixed script:
Updated: after a short research, I found that such a Greasemonkey script already exists: "remove the javascript call that opens a new window for links in messages in Gmail" (src here). Btw, did I say that Greasemonkey rocks? But since the recent gmail change, this fix doesn't work anymore. Google seems to have fun fighting with the firefox js community. Anyway, I mailed the creator of the script the fixed version, hopefully he will put it live fast. Until he does it, here's the fixed script:
- // ==UserScript==
- // @name GMail Single Window
- // @namespace http://www.arantius.com/misc/greasemonkey/
- // @description Remove the javascript call that opens a new window for links in messages in Gmail.
- // @include http*://mail.google.com/*
- // ==/UserScript
-
- //
- // Originally written by Anthony Lieuallen of http://www.arantius.com/
- // Licensed for unlimited modification and redistribution as long as
- // this notice is kept intact.
- //
- // Changed by Calin Uioreanu, 12.08.2005
- // - changed domain name (gmail->mail)
- // - removed the target=_blank from all gmail links
- //
-
- dump('===== Load Gmail Single Window =====n');
-
- (function(){
- var res = document.evaluate("//a[contains(./@onclick, 'top.js.OpenExtLink')]",
- document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
- var i, el;
- for (i=0; el=res.snapshotItem(i); i++) {
- el.removeAttribute('onclick');
- el.removeAttribute('target');
- }
- })()