Debian package: Use variable for common path in debian/rules
[conkeror.git] / modules / special-buffer.js
blob69ec738b4be4edb71d1b020fab5daf67c845ce36
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 require("buffer.js");
10 define_buffer_local_hook("special_buffer_generated_hook");
11 define_current_buffer_hook("current_special_buffer_generated_hook", "special_buffer_generated_hook");
14 function special_buffer (window) {
15     this.constructor_begin();
16     keywords(arguments);
17     conkeror.buffer.call(this, window, forward_keywords(arguments));
18     this.generated = false;
20     var buffer = this;
21     add_hook.call(this, "buffer_loaded_hook", function () {
22             buffer.generated = true;
23             buffer.generate();
24             call_after_timeout(function () {
25                     special_buffer_generated_hook.run(buffer);
26                 }, 0);
27         });
28     this.web_navigation.loadURI("chrome://conkeror-gui/content/blank.html", Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
29                                 null /* referrer */, null /* post data */, null /* headers */);
30     this.constructor_end();
32 special_buffer.prototype = {
33     constructor: special_buffer,
34     __proto__: buffer.prototype,
35     toString: function () "#<special_buffer>",
36     generate: function () {
37         throw Error("subclasses of special_buffer must define 'generate'");
38     }
41 provide("special-buffer");