Folks,

I have the following content script:

// ==UserScript==
// @name           Scrollbar Anywhere
// @description    Use the scrollbar from anywhere on the page, or
mimic grab-n-drag style scrolling
// @namespace      aeosynth
// @include        *
// @version        0.1.0
// @copyright      2009, James Campos
// @license        cc-by-3.0; http://creativecommons.org/licenses/by/3.0/
// ==/UserScript==

//start preferences
const grabndrag = false
const button = 2//0 = left, 1 = middle, 2 = right
//end preferences


var X, Y, ratioX, ratioY, initialX, initialY
var flagFirstTime =new Boolean(true);
window.addEventListener('mousedown', function(e) {if (e.button ==
button) start(e)}, true)
function start(e) {

        if (flagFirstTime)
        {
        initialX = window.scrollX
        initialY = window.scrollY
        }
        flagFirstTime = false


        X = e.clientX
        Y = e.clientY
        if (grabndrag)
                ratioX = ratioY = 0.1
        else if (window.scrollMaxY) {
                ratioX = (window.innerWidth + window.scrollMaxX) / 
window.innerWidth
                ratioY = (window.innerHeight + window.scrollMaxY) /
window.innerHeight
        } else {//chrome doesn't support window.scrollMax
                ratioX = document.width / window.innerWidth
                ratioY = document.height / window.innerHeight
        }
        window.addEventListener('mousemove', move, true)
        window.addEventListener('mouseup', end, true)
}
function move(e)
{       var diff_X_scroll ,diff_y_scroll
        diff_X_scroll = ratioX * (e.clientX - X)
        diff_y_scroll = ratioY * (e.clientY - Y)
        window.scrollBy(diff_X_scroll ,  diff_y_scroll )
        X = e.clientX
        Y = e.clientY

}
function end(e) {
        window.removeEventListener('mousemove', move, true)
        window.removeEventListener('mouseup', end, true)
        if (  (Math.abs(window.scrollX-initialX)>1) || (Math.abs
(window.scrollY-initialY)>1))
                document.oncontextmenu = function(){return false;}
        else document.oncontextmenu = function(){return true;}
        flagFirstTime = true
}


This code works fine  for most of the pages. However, in gmail
standart view it does not work. Does anyone knows why?
Does gmail with labs feature blocks anything?
As far as I know, the code is injected, but not fired.
HELP!

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to