sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 1afaf1bb20d3f64c1b98932850e5b45839bbeb01
parent 2c3bfee77eefdd23efadbee4a1738c9e9bda5475
Author: Julien Steinhauser <unknown>
Date:   Sat,  3 Oct 2009 19:15:20 +0200

Added surf.suckless.org/files/middle_click_link.md
Diffstat:
Asurf.suckless.org/files/middle_click_link.md | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/surf.suckless.org/files/middle_click_link.md b/surf.suckless.org/files/middle_click_link.md @@ -0,0 +1,32 @@ +MIDDLE CLICK LINKS +================== + +Description +----------- + +This script must be deployed into the ~/.surf/user.js and one will be able to open link +in a new window with middleclick or with control click. + +(function() { + window.addEventListener("click", function(e) { + if ( + e.button == 1 // for middle click + //|| e.ctrlKey // for ctrl + click + ) { + var new_uri = e.srcElement.href; + if (new_uri) { + e.stopPropagation(); + e.preventDefault(); + window.open(new_uri); + } + } + }, false); +})(); + +Author +------ + +- Original author n30n , actual revision chm.duquesne. + +The last version of this script is on http://www.uzbl.org/wiki/middle_click_links +under a [CC Attribution-Noncommercial-Share Alike 3.0 Unported license](http://creativecommons.org/licenses/by-nc-sa/3.0/).