2013-05-30 14:51:44 +02:00
|
|
|
//!javascript
|
|
|
|
//<adblock_subscriptions___SCRIPT
|
|
|
|
extensions.load("adblock_subscriptions", {
|
|
|
|
//<adblock_subscriptions___CONFIG
|
|
|
|
|
|
|
|
// Shortcut to subscribe to a filterlist
|
2014-09-11 15:54:05 +02:00
|
|
|
scSubscribe : null,
|
2013-05-30 14:51:44 +02:00
|
|
|
// Command to subscribe to a filterlist
|
2014-09-11 15:54:05 +02:00
|
|
|
cmdSubscribe : "adblock_subscribe",
|
2013-05-30 14:51:44 +02:00
|
|
|
|
|
|
|
// Shortcut to unsubscribe from a filterlist
|
2014-09-11 15:54:05 +02:00
|
|
|
scUnsubscribe : null,
|
2013-05-30 14:51:44 +02:00
|
|
|
|
|
|
|
// Command to unsubscribe from a filterlist
|
|
|
|
cmdUnsubscribe : "adblock_unsubscribe",
|
|
|
|
|
|
|
|
// Shortcut to update subscriptions and reload filter rules
|
|
|
|
// Note that dwb will also update all subscriptions on startup
|
2014-09-11 15:54:05 +02:00
|
|
|
scUpdate : null,
|
2013-05-30 14:51:44 +02:00
|
|
|
|
|
|
|
// Command to update subscriptions and reload filter rules
|
|
|
|
// Note that dwb will also update all subscriptions on startup
|
2014-09-11 15:54:05 +02:00
|
|
|
cmdUpdate : "adblock_update",
|
2013-05-30 14:51:44 +02:00
|
|
|
|
2014-09-11 15:54:05 +02:00
|
|
|
// Path to the filterlist directory, will be created if it doesn't exist.
|
2014-09-12 09:13:34 +02:00
|
|
|
filterListDir : "~/.config/dwb/adblock_lists"
|
2013-05-30 14:51:44 +02:00
|
|
|
//>adblock_subscriptions___CONFIG
|
|
|
|
});
|
|
|
|
//>adblock_subscriptions___SCRIPT
|
2013-08-04 16:07:33 +02:00
|
|
|
//<navtools___SCRIPT
|
|
|
|
extensions.load("navtools", {
|
|
|
|
//<navtools___CONFIG
|
|
|
|
// Shortcut for navigating to the next page
|
|
|
|
forwardBind : "]]",
|
|
|
|
|
|
|
|
// Shortcut for navigating to the previous page
|
|
|
|
backBind : "[[",
|
|
|
|
|
2014-01-04 16:16:02 +01:00
|
|
|
// Go up one directory, e.g. from http://www.example.com/foo/bar to
|
2013-08-04 16:07:33 +02:00
|
|
|
// http://www.example.com/foo
|
2014-01-04 16:16:02 +01:00
|
|
|
updirBind : "gu",
|
2013-08-04 16:07:33 +02:00
|
|
|
|
2014-01-04 16:16:02 +01:00
|
|
|
// Go to top directory, e.g. from http://www.example.com/foo/bar to
|
2013-08-04 16:07:33 +02:00
|
|
|
// http://www.example.com
|
2014-01-04 16:16:02 +01:00
|
|
|
topdirBind : "gU",
|
2013-08-04 16:07:33 +02:00
|
|
|
|
|
|
|
// Patterns to match against when searching for "next"-links
|
|
|
|
nextPatterns : "next,more,>,\u2192,\xbb,\u226b,>>",
|
|
|
|
|
|
|
|
// Patterns to match against when searching for "previous"-links
|
|
|
|
previousPatterns : "prev,previous,back,<,\u2190,\xab,\u226a,<<"
|
|
|
|
|
|
|
|
//>navtools___CONFIG
|
|
|
|
});
|
|
|
|
//>navtools___SCRIPT
|
2015-05-28 16:05:27 +02:00
|
|
|
|
2014-01-04 15:08:56 +01:00
|
|
|
//<contenthandler___SCRIPT
|
|
|
|
extensions.load("contenthandler", {
|
|
|
|
//<contenthandler___CONFIG
|
|
|
|
// The handler can either be a string or a function, if it is a string
|
|
|
|
// %u will be replaced with the uri of the request, if the handler is a
|
|
|
|
// function the first parameter of the function will be the uri and the
|
|
|
|
// function must return the command to execute.
|
2014-01-04 16:16:02 +01:00
|
|
|
|
2014-01-04 15:08:56 +01:00
|
|
|
// Handle requests based on filename extension
|
|
|
|
extension : {
|
2014-01-06 10:55:10 +01:00
|
|
|
// Note that the extension handler does not always work (e.g. on
|
|
|
|
// torrenthound). As a workaround transmission can be configured to watch
|
|
|
|
// for the download path.
|
|
|
|
"torrent" : "trc -a '%u'"
|
|
|
|
|
|
|
|
// "pdf" : "xterm -e 'wget %u --directory-prefix=~/mypdfs'"
|
2014-01-04 15:08:56 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
// Handle requests based on URI scheme
|
|
|
|
uriScheme : {
|
2014-01-04 16:21:54 +01:00
|
|
|
// Note: does not work with urxvt.
|
2014-01-04 16:16:02 +01:00
|
|
|
ftp : function(uri) {
|
|
|
|
if (uri[uri.length-1] == "/")
|
|
|
|
return "xterm -e 'ncftp " + uri + "'";
|
|
|
|
else
|
|
|
|
return "xterm -e 'ncftpget " + uri + "'";
|
|
|
|
},
|
|
|
|
|
|
|
|
// We need to use 'sh -c' since we need to use a pipe so that xclip can
|
|
|
|
// read from stdin
|
|
|
|
mailto : function(uri) {
|
|
|
|
uri=uri.replace(/mailto:/, "")
|
|
|
|
uri=uri.replace(/\?/, " ")
|
|
|
|
return "sh -c ' echo " + uri + " | xclip -i'";
|
|
|
|
},
|
|
|
|
|
|
|
|
// 'trc' is a wrapper script that will launch transmission-daemon if not
|
|
|
|
// already started.
|
|
|
|
// magnet: "transmission-remote -a '%u'"
|
|
|
|
magnet: "trc -a '%u'"
|
2014-01-04 15:08:56 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
// Handle requests based on MIME type
|
|
|
|
mimeType : {
|
|
|
|
// "application/pdf" : "xterm -e 'wget %u --directory-prefix=~/mypdfs'"
|
|
|
|
}
|
|
|
|
//>contenthandler___CONFIG
|
|
|
|
|
|
|
|
});
|
|
|
|
//>contenthandler___SCRIPT
|