我需要在 fennec 插件中处理页面滚动我做了接下来的事情:
function onScrollHand(window, event) {
showToast(window, "Scrolling");
}
var windowListener = {
onOpenWindow: function(aWindow) {
let domWindow = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
domWindow.addEventListener("onscroll", function onScroll(event) {
onScrollHand(domWindow ,event);
}, false);
},
};
function startup(aData, aReason) {
let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
wm.addListener(windowListener);
}
而且我没有收到滚动事件。有人有任何想法或一些工作代码吗?