Middle click links

Config version

In your uzbl config

@bind  <Button2>  = sh 'uzbl-browser -u \@SELECTED_URI'

Javascript version

Description

Open links in a new instance by middle clicking on them.

middle_click.js

(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);
})();

Installation

Save the above script to a directory of your choice and add it to the load_commit_handler for example with:

@on_event LOAD_COMMIT script @scripts_dir/middle_click.js
 
middle_click_links.txt · Last modified: 2010/01/15 12:41 by mason.larobina
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki