var ScreenshotSaver ScreenshotSaver save function url fpath window get

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
var ScreenshotSaver = { };
ScreenshotSaver.save = function(url, fpath) {
window.getBrowser().addEventListener(
"load",
function() {
ScreenshotSaver._dump_screenshot(fpath);
},
false);
window.content.location.href = url;
};
ScreenshotSaver._dump_screenshot = function(fpath) {
repl.print('_on_DOM_load');
var mixin = ScreenshotSaver._gen_screengrab_mixin(fpath);
ScreenshotSaver._hook_screengrab(mixin);
Screengrab.grabCompleteDocument();
ScreenshotSaver._unhook_screengrab(mixin);
// FIXME: removeEventListener('load', «???», false);
};