whitespace
[conkeror.git] / modules / special-buffer.js
blob7549ba80ae4ea7935549a636f17be8e14bb219db
1 /**
2  * (C) Copyright 2008 Jeremy Maitin-Shepard
3  *
4  * Use, modification, and distribution are subject to the terms specified in the
5  * COPYING file.
6 **/
8 in_module(null);
10 require("buffer.js");
12 define_buffer_local_hook("special_buffer_generated_hook");
13 define_current_buffer_hook("current_special_buffer_generated_hook", "special_buffer_generated_hook");
16 function special_buffer (window) {
17     this.constructor_begin();
18     keywords(arguments);
19     conkeror.buffer.call(this, window, forward_keywords(arguments));
20     this.generated = false;
22     var buffer = this;
23     add_hook.call(this, "buffer_loaded_hook", function () {
24             buffer.generated = true;
25             buffer.generate();
26             call_after_timeout(function () {
27                     special_buffer_generated_hook.run(buffer);
28                 }, 0);
29         });
30     this.web_navigation.loadURI("chrome://conkeror-gui/content/blank.html", Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
31                                 null /* referrer */, null /* post data */, null /* headers */);
32     this.constructor_end();
35 special_buffer.prototype.__proto__ = buffer.prototype;
37 // Sub-classes must define a generate method
39 provide("special-buffer");