firemail
标题:
Mozillar的事件系统
[打印本页]
作者:
hechengjin
时间:
2015-11-15 10:38
标题:
Mozillar的事件系统
evente.jpg
(47.44 KB, 下载次数: 613)
下载附件
2015-11-15 10:37 上传
作者:
hechengjin
时间:
2016-5-7 16:57
本帖最后由 hechengjin 于 2016-5-7 17:02 编辑
outer-window-destroyed
chrome-document-global-created
function close(window) {
let deferred = defer();
let toplevelWindow = getToplevelWindow(window);
let outerId = getOuterId(toplevelWindow);
events.on("outer-window-destroyed", function onclose({subject}) {
let id = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
if (id == outerId) {
events.off("outer-window-destroyed", onclose);
deferred.resolve();
}
}, true);
window.close();
return deferred.promise;
}
复制代码
const
events = require(
'../system/events'
);
comm-central
/
mozilla
/
addon-sdk
/
source
/
lib
/
sdk
/
system
/
events.js
\xulrunner\modules\commonjs\sdk\system\events.js
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3