[Greasemonkey] Greasemonkey 0.4 attempt II

Jason Green jason at everydayjones.com
Tue Jul 5 23:25:06 EDT 2005


Can you combine your openlinksintabs.js with the below script BUT only 
allowing it when holding down CTRL? I'd like to hold down CRTL and just 
sweep my mouse over links to have them open in new tabs.

// ==UserScript==
// @name          Don't Click It
// @namespace     http://www.slightlyremarkable.com/
// @description      Inspired by DONTCLICK.IT, this Greasemonkey script 
permits user-interface navigation without mouse clicking.
// @include       *
// ==/UserScript==
window.addEventListener ("load", function (e){
 var $_globTimer, $_tempObj;
 var l, fClick, k = 0;
 while(l = document.links[k++]){
      fClick = l.onclick;
      l.addEventListener('mouseover', function(e){
        if(!e.shiftKey){
          (this.onclick)();
        }
      }, false);
      l.addEventListener('mouseover', function(e){
       if(e.ctrlKey){
          window.open(this.href, this.target);
          return false;
       }
       if(!e.shiftKey){
        if(!this.target){
           location.href = this.href;
        } else {
           window.open(this.href, this.target);
        }
       }
      }, false);
  fClick = null;
 }
 var f, e, i = 0, j = 0;
 while(f = document.forms[i++]){
  j = 0;
  while(e = f.elements[j++]){
   if(e.type){
    if(e.type == 'text' || e.type == 'textarea' || e.type == 'password'){
       e.addEventListener('mouseover', function(){this.select()}, false);
    } else if(e.type == 'select-one'){
       e.addEventListener('mouseover', function(){this.focus()}, false);
    } else {
       e.addEventListener('mouseover', function(e){
        if(!e.shiftKey){
           this.click();
        }
       }, false);
    }
   }
  }
 }
}, false);


-Jason



Aaron Boodman wrote:

>I've fixed the bugs that people brought up on the last XPI as well as
>the two that I knew about.
>
>In total, here are the changes from the last XPI:
>
>* no scripts included by default
>* fixed pref namespace double-slash bug that was brought up
>* fixed commands menu not disabling when no commands available bug
>* fixed commands' accel text not showing up bug
>* added GM_openInTab :-)
>* modified the signature for GM_registerMenuCommand to (commandName,
>commandFunc, accelKey, accelModifiers, accessKey) because it was
>bugging me the other way.
>
>Also including two scripts to test the new functionality.
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Greasemonkey mailing list
>Greasemonkey at mozdev.org
>http://mozdev.org/mailman/listinfo/greasemonkey
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050705/57e6a184/attachment.htm


More information about the Greasemonkey mailing list