smbc-mode: new page mode for smbc-comics.com
[conkeror/arlinius.git] / modules / page-modes / smbc.js
blob1a948f7ad9c59d94db36c53a6fc50d4994411f12
1 /**
2  * (C) Copyright 2012 John J. Foerch
3  *
4  * Use, modification, and distribution are subject to the terms specified in the
5  * COPYING file.
6 **/
8 define_page_mode("smbc-mode",
9     build_url_regexp($domain = "www.smbc-comics"),
10     function enable (buffer) {
11         buffer.page.local.browser_relationship_patterns = {};
12         buffer.page.local.browser_relationship_patterns[RELATIONSHIP_NEXT] =
13             [function (doc) xpath_find_node(doc, "//map[@name='buttons']/area[4]")];
14         buffer.page.local.browser_relationship_patterns[RELATIONSHIP_PREVIOUS] =
15             [function (doc) xpath_find_node(doc, "//map[@name='buttons']/area[2]")];
16     },
17     function disable (buffer) {},
18     $display_name = "SMBC");
20 page_mode_activate(smbc_mode);
22 provide("smbc");