Weblog
I want my window, dammit! (or how to destroy target _blank)
I've always thought user should be able to choose where to load new documents from links. I say you as developer can use a cookie and provide that option if user wants to, but only if user wants to (see my preferences form at the end of page). A lot of other people think the best option is not letting them think and open everything in a new window. I hate those situations. What if i want to stay in my window? Hey, if i like your site i'll be back... Anyway, they insist in using target _blank. Well, all that's finished. Bye bye target _blank. Wanna know how? Keep reading...
How to destroy target _blank
- Get Mozilla FireFox last version. This method works from 1.0
- Install the greasemonkey extension, that allows to execute user scripts on foreign sites
- Restart FireFox
- Then visit this wonder
- From there you can use your Tools menu and Install User Script
- Enjoy it! From now on, if you want a link to open in a new window or tab, just use the context menu or use your favorite shortcut (I love the CTRL+click)
Comments on this entry
-
Muchas gracias por el truco. Es muy útil.
Yo también usaba el CTRL+click, pero luego descubrí que los enlaces se pueden abrir en pestañas nuevas pulsando el botón central del ratón (en mi caso la rueda) y me resulta aún más cómodo.
Por cierto, creo que en la secuencia de instalación del script deberías haber puesto lo de reiniciar Firefox en el punto 3, después de instalar greasemonkey. Si no, alguien que sea nuevo en Firefox se puede volver loco buscando el Install User Script. Es sólo una sugerencia.
Gracias de nuevo y un saludo.
-
Tienes razón, acabo de cambiar el orden, es más correcto, gracias por el feedback y a disfrutar la extensión :)
-
haber... se me hace que hay algo que me estoy perdiendo...
La extensión está instalada así como el script, y se "debe" de ejecutar en:
http://*
*
*:*
*.*
*/*
Pero... mandando al target _blank
Any help will be apreciated =)
-
Edgar enviame un email o pon la url donde no funciona este script, gracias. tambien puedes poner tu email tranquilamente, me ha devuelto un mensaje porque era una direccion falsa (añado un prefijo al dominio, asi que no recibirás spam). saludos.
-
Como me habia quedado con la duda intenté e intenté incluso hice un .html con varias opciones de prueba (tanto para tu script como para los que vienen integrados) y nada resultó...
Lo "raro" fué que tras reiniciar mi pc y llegar a los dominios de Debian todo funcionó... ya sabes hay que tener cuidado con M$ puede hacer que falle hasta lo impensable...
Agradezco tu atención...
Por cierto, he leido muchos artículos en la red que hablan sobre la "inteligencia" de los harvesters ya es un truco conocido el _NOSPAM_ y derivados como %20usuario@isp.tld y cosas por el estilo...
Hace algún tiempo hice una pequeña función para evitar eso, me permito pegartela:
function mail(usuario,isp,tld)
{
var protocolo = unescape('%6d%61%69%6c%74%6f');
var aRoba = unescape('%'+'40');
var correo = ''+usuario+aRoba+isp+'.'+tld+'';
document.write(correo);
}
Obviamente ya sabes el output que tiene.
-
We've got a directory of user scripts started...
-
Bien, esa filosofía es muy personal y se puede defender..., pero entonces, porqué narices pones enlaces en ventana nueva dentro de tu página? Tienes miedo de que vaya a otra web y no vuelva a la tuya...?
Que conste que tengo las preferencias establecidas como "no abrir los recursos en ventana nueva". Francamente te contradices mucho...
-
Bien, esa filosofía es muy personal y se puede defender..., pero entonces, porqué narices pones enlaces en ventana nueva dentro de tu página? Tienes miedo de que vaya a otra web y no vuelva a la tuya...?
Que conste que tengo las preferencias establecidas como "no abrir los recursos en ventana nueva". Francamente te contradices mucho...
-
I would also add "_new" targets to the if:
if (external[k].href && (external[k].target=="_blank" || external[k].target=="_userwww" || external[k].target=="_new")) {
-
Nice hack!
It doesn't work with other combinations (e.g. "target=Top Frame"). This can be fixed by removing the external[k].target check completely. After all, we want anything other than _self ?
Patch follows.
--- killblank.user.js~ 2004-12-09 02:03:15.000000000 +0100
+++ killblank.user.js 2005-05-25 23:57:35.000000000 +0200
@@ -7,8 +7,8 @@
(function () {
var external = document.links;
for (var k=0; k
-
Robert, you're right. It'd be better to remove the target check. Javascript file already updated. Thanx.
-
Unfortunately if you remove all target attributes you'll mess up the sites that use framesets.
-
#
2005-05-25 18:21:01
* meddle
* [e]
* url
Robert, you're right. It'd be better to remove the target check. Javascript file already updated. Thanx.
#
2005-05-31 23:24:20
* Assaph Mehr
* [e]
Unfortunately if you remove all target attributes you'll mess up the sites that use framesets.
---------------------------------
target=_
anything with a normal name = frame
from w3c.org
6.16 Frame target names
Except for the reserved names listed below, frame target names (%FrameTarget; in the DTD) must begin with an alphabetic character (a-zA-Z). User agents should ignore all other target names.
The following target names are reserved and have special meanings.
_blank
The user agent should load the designated document in a new, unnamed window.
_self
The user agent should load the document in the same frame as the element that refers to this target.
_parent
The user agent should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to _self if the current frame has no parent.
_top
The user agent should load the document into the full, original window (thus canceling all other frames). This value is equivalent to _self if the current frame has no parent.
-
wugh that is unreadable now :o ... anyway target=_blank , target=_self, target=_parent, target=_top ::: target="name" is generally used for frames and should indeed stay
Closed
Due to spam bullshit this weblog has been closed to comments, it was impossible to keep my blacklist script updated. You can still figure out my email and send me your message. Sorry.