Nice.
What would you like it to do?
This would make a working extension out of the content script:
manifest.json
toolstrip.htmlCode:{ "content_scripts": [ { "js": [ "content_script.js" ], "matches": [ "http://*/*", "https://*/*" ] } ], "description": "Mouse gestures for chrome", "name": "mouse-gestures", "toolstrips": [ "toolstrip.html" ], "version": "0.1" }
content_script.jsCode:<html> <body> <div id="button" class="toolstrip-button"> Waiting for input </div> </body> </html>
That was easy, but probably not what you meant. ;-)Code:// ==UserScript== // @name Mouse Gestures for Google Chrome // @author vhanla // @namespace http://www.codigobit.net/ // @version 1.0 // @description Allows to use mouse gestures for navigating through pages // @include * // @exclude // ==/UserScript== var posx = 0; var posy = 0; var estado = false; var gestdown = function(event) { if (event.which) button = (event.which < 2) ? "LEFT" : ((event.which == 2) ? "MIDDLE" : "RIGHT"); if (button =="RIGHT"){ estado=true; posx=event.clientX; posy=event.clientY; document.oncontextmenu = new Function("return false") } } var gestup = function(event) { if (estado){ estado=false; if(event.clientX+25<posx){ window.history.back(); } else if(event.clientX-25>posx){ window.history.forward(); } else if(event.clientY-25>posy){ window.open(); } else if(event.clientY+25<posy){ window.close(); } else void(document.oncontextmenu=null) } } window.addEventListener("mousedown", gestdown, false); window.addEventListener("mouseup", gestup, false);


LinkBack URL
About LinkBacks




Reply With Quote

). Credit goes to rock_galore for posting the manifest and content script...all I did was package it.