3

In recent version of Firefox 31+ the startScroll(e) function was changed and should be called with startScroll(scrolldir, screenX, screenY)

Diff of the change: https://hg.mozilla.org/integration/mozilla-inbound/diff/cc298e4b0f47/toolkit/content/widgets/browser.xml

Before the change I could initiate startScroll manually from my classic bootstrap.js extension with:

aWindow.gBrowser.selectedBrowser.startScroll(e);

I've received a tip on mozilla IRC channel to use sendAsyncMessage "Autoscroll:Start" so I tried various combinations of

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.

Bare minimum boostrap.js extension of my problem can be seen on http://pastebin.com/azv1jePt

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

Thanks
Senicar

senicar
  • 61
  • 3

1 Answers1

0

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

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

Hope this helps