Firefox startScroll and sendAsyncMessage

In the latest Firefox 31+ the startScroll (e) function has been changed and must be called with startScroll (scrolldir, screenX, screenY)

Reset change:

Before changing, I can start startScroll manually from my classic bootstrap.js extension with:



I got feedback on mozilla's IRC channel to use sendAsyncMessage "Autoscroll: Start" so I tried various combinations

aWindow.gBrowser.selectedBrowser.startScroll("NSEW", e.screenX, e.screenY);
aWindow.gBrowser.selectedBrowser.messageManager.sendAsyncMessage("Autoscroll:Start", {scrolldir:"NSEW", screenX:e.screenX, screenY:e.screenY});


but nothing works.

Minor minimal boostrap.js extension of my problem can be seen at

Does anyone know how to manually start autoscroll in a newer version of Firefox directly from the bootstrap.js extension, without using any chrome scripts?



source to share

1 answer

What worked for me was to simulate the mousedown middle button event from the script frame (no need to call startScroll or sendAsyncMessage):

content.document.documentElement.dispatchEvent(new content.MouseEvent("mousedown", {
    view: content,
    bubbles: true,
    cancelable: true,
    button: 1,
    screenX: /* anEvent.screenX */,
    screenY: /* anEvent.screenY */


Hope it helps



All Articles