mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 10:26:42 +00:00
400 lines
29 KiB
JSON
400 lines
29 KiB
JSON
[
|
|
{
|
|
"Command": [],
|
|
"Constant": [],
|
|
"Constructor": [],
|
|
"Deprecated": [],
|
|
"Field": [],
|
|
"Function": [],
|
|
"Method": [
|
|
{
|
|
"def": "URLDispatcher:dispatchURL(scheme, host, params, fullUrl, senderPid)",
|
|
"desc": "Dispatch a URL to an application according to the defined `url_patterns`.",
|
|
"doc": "Dispatch a URL to an application according to the defined `url_patterns`.\n\nParameters:\n * scheme - A string containing the URL scheme (i.e. \"http\")\n * host - A string containing the host requested (e.g. \"www.hammerspoon.org\")\n * params - A table containing the key/value pairs of all the URL parameters\n * fullURL - A string containing the full, original URL. This is the only parameter used in this implementation.\n * senderPID - An integer containing the PID of the application that opened the URL, if available (otherwise -1)\n\nNotes:\n * The parameters (follow to the [httpCallback](http://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback) specification)",
|
|
"examples": [],
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "188",
|
|
"name": "dispatchURL",
|
|
"notes": [
|
|
" * The parameters (follow to the [httpCallback](http://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback) specification)"
|
|
],
|
|
"parameters": [
|
|
" * scheme - A string containing the URL scheme (i.e. \"http\")",
|
|
" * host - A string containing the host requested (e.g. \"www.hammerspoon.org\")",
|
|
" * params - A table containing the key/value pairs of all the URL parameters",
|
|
" * fullURL - A string containing the full, original URL. This is the only parameter used in this implementation.",
|
|
" * senderPID - An integer containing the PID of the application that opened the URL, if available (otherwise -1)"
|
|
],
|
|
"returns": [],
|
|
"signature": "URLDispatcher:dispatchURL(scheme, host, params, fullUrl, senderPid)",
|
|
"stripped_doc": "",
|
|
"type": "Method"
|
|
},
|
|
{
|
|
"def": "URLDispatcher:start()",
|
|
"desc": "Start dispatching URLs according to the rules",
|
|
"doc": "Start dispatching URLs according to the rules\n\nParameters:\n * None",
|
|
"examples": [],
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "312",
|
|
"name": "start",
|
|
"notes": [],
|
|
"parameters": [
|
|
" * None"
|
|
],
|
|
"returns": [],
|
|
"signature": "URLDispatcher:start()",
|
|
"stripped_doc": "",
|
|
"type": "Method"
|
|
}
|
|
],
|
|
"Variable": [
|
|
{
|
|
"def": "URLDispatcher.decode_slack_redir_urls",
|
|
"desc": "If true, handle Slack-redir URLs to apply the rule on the destination URL. Defaults to `true`",
|
|
"doc": "If true, handle Slack-redir URLs to apply the rule on the destination URL. Defaults to `true`",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "30",
|
|
"name": "decode_slack_redir_urls",
|
|
"signature": "URLDispatcher.decode_slack_redir_urls",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.default_handler",
|
|
"desc": "Default URL handler (Defaults to `\"com.apple.Safari\"`)",
|
|
"doc": "Default URL handler (Defaults to `\"com.apple.Safari\"`)\n\nNotes:\nCan be a string containing the Bundle ID of an application, or a function\nthat takes one argument, and which will be invoked with the URL to open.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "21",
|
|
"name": "default_handler",
|
|
"notes": [
|
|
"Can be a string containing the Bundle ID of an application, or a function",
|
|
"that takes one argument, and which will be invoked with the URL to open."
|
|
],
|
|
"signature": "URLDispatcher.default_handler",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.logger",
|
|
"desc": "Logger object used within the Spoon. Can be accessed to set the default log",
|
|
"doc": "Logger object used within the Spoon. Can be accessed to set the default log\nlevel for the messages coming from the Spoon.\n\nNotes:\nExample: `spoon.URLDispatcher.logger.setLogLevel(\"debug\")`",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "99",
|
|
"name": "logger",
|
|
"notes": [
|
|
"Example: `spoon.URLDispatcher.logger.setLogLevel(\"debug\")`"
|
|
],
|
|
"signature": "URLDispatcher.logger",
|
|
"stripped_doc": "level for the messages coming from the Spoon.",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.pat_files",
|
|
"desc": "Internal variable containing a table where the pattern lists read from files are kept indexed by file name, and automatically updated.",
|
|
"doc": "Internal variable containing a table where the pattern lists read from files are kept indexed by file name, and automatically updated.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "114",
|
|
"name": "pat_files",
|
|
"signature": "URLDispatcher.pat_files",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.pat_watchers",
|
|
"desc": "Internal variable containing a table where the watchers for the pattern files are kept indexed by file name.",
|
|
"doc": "Internal variable containing a table where the watchers for the pattern files are kept indexed by file name.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "119",
|
|
"name": "pat_watchers",
|
|
"signature": "URLDispatcher.pat_watchers",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.set_system_handler",
|
|
"desc": "If true, URLDispatcher sets itself as system handler for http requests.",
|
|
"doc": "If true, URLDispatcher sets itself as system handler for http requests.\nDefaults to `true`",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "108",
|
|
"name": "set_system_handler",
|
|
"signature": "URLDispatcher.set_system_handler",
|
|
"stripped_doc": "Defaults to `true`",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.url_patterns",
|
|
"desc": "URL dispatch rules.",
|
|
"doc": "URL dispatch rules.\n\nNotes:\n A table containing a list of dispatch rules. Rules are evaluated in the\n order they are declared. Each rule is a table with the following structure:\n `{ url-patterns, app-bundle-ID-or-function, function, app-patterns }`\n * `url-patterns` can be: (a) a single pattern as a string, (b) a table\n containing a list of strings, or (c) a string containing the path of a\n file from which the patterns will be read (if the string contains a valid\n filename it's used as a file, otherwise as a pattern). In case (c), a\n watcher will be set to automatically re-read the contents of the file\n when it changes. If a relative path is given (not starting with a \"/\"),\n then it is considered to be relative to the Hammerspoon configuration\n directory.\n * If `app-bundle-ID-or-function` is specified as a string, it is\n interpreted as a macOS application ID, and that application will be used\n to open matching URLs. If it is a function pointer, or not given but\n \"function\" is provided, it is expected to be a function that accepts a\n single argument, and it will be called with the URL.\n * If `app-patterns` is given, it should be a string or a table containing a\n pattern/list of patterns, and the rule will only be evaluated if the URL\n was opened from an application whose name matches one of those patterns.\n * Note that the patterns are [Lua patterns](https://www.lua.org/pil/20.2.html)\n and not regular expressions.\n * Defaults to an empty table, which has the effect of having all URLs\n dispatched to the `default_handler`.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "69",
|
|
"name": "url_patterns",
|
|
"notes": [
|
|
" A table containing a list of dispatch rules. Rules are evaluated in the",
|
|
" order they are declared. Each rule is a table with the following structure:",
|
|
" `{ url-patterns, app-bundle-ID-or-function, function, app-patterns }`",
|
|
" * `url-patterns` can be: (a) a single pattern as a string, (b) a table",
|
|
" containing a list of strings, or (c) a string containing the path of a",
|
|
" file from which the patterns will be read (if the string contains a valid",
|
|
" filename it's used as a file, otherwise as a pattern). In case (c), a",
|
|
" watcher will be set to automatically re-read the contents of the file",
|
|
" when it changes. If a relative path is given (not starting with a \"/\"),",
|
|
" then it is considered to be relative to the Hammerspoon configuration",
|
|
" directory.",
|
|
" * If `app-bundle-ID-or-function` is specified as a string, it is",
|
|
" interpreted as a macOS application ID, and that application will be used",
|
|
" to open matching URLs. If it is a function pointer, or not given but",
|
|
" \"function\" is provided, it is expected to be a function that accepts a",
|
|
" single argument, and it will be called with the URL.",
|
|
" * If `app-patterns` is given, it should be a string or a table containing a",
|
|
" pattern/list of patterns, and the rule will only be evaluated if the URL",
|
|
" was opened from an application whose name matches one of those patterns.",
|
|
" * Note that the patterns are [Lua patterns](https://www.lua.org/pil/20.2.html)",
|
|
" and not regular expressions.",
|
|
" * Defaults to an empty table, which has the effect of having all URLs",
|
|
" dispatched to the `default_handler`."
|
|
],
|
|
"signature": "URLDispatcher.url_patterns",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.url_redir_decoders",
|
|
"desc": "URL redirection decoders. Default value: empty list",
|
|
"doc": "URL redirection decoders. Default value: empty list\n\nNotes:\nList containing optional redirection decoders (other than the known Slack\ndecoder, which is enabled by `URLDispatcher.decode_slack_redir_urls` to\napply to URLs before dispatching them. Each list element must be a list\nitself with a maximum of five elements:\n * `decoder-name`: (String) a name to identify the decoder;\n * `decoder-pattern-or-function`: (String or Function) if a string is\n given, it is used as a [Lua pattern](https://www.lua.org/pil/20.2.html)\n to match against the URL. If a function is given, it will be called with\n arguments `scheme`, `host`, `params`, `fullUrl`, `senderPid` (the same\n arguments as passed to\n [hs.urlevent.httpCallback](https://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback)),\n and must return a string that contains the URL to be opened. The\n returned value will be URL-decoded according to the value of `skip-decode-url` (below).\n * `pattern-replacement`: (String) a replacement pattern to apply if a\n match is found when a decoder pattern (previous argument) is provided.\n If a decoder function is given, this argument is ignored.\n * `skip-decode-url`: (Boolean, optional) whether to skip URL-decoding of the\n resulting string (defaults to `false`, by default URLs are always decoded)\n * `source-application`: (String or Table, optional): a pattern or list of\n patterns to match against the name of the application from which the URL\n was opened. If this parameter is present, the decoder will only be\n applied when the application matches. Default is to apply the decoder\n regardless of the application.\nIf given as strings, `decoder-pattern-or-function` and `pattern-replacement`\nare passed as arguments to\n[string.gsub](https://www.lua.org/manual/5.3/manual.html#pdf-string.gsub)\napplied on the original URL.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "35",
|
|
"name": "url_redir_decoders",
|
|
"notes": [
|
|
"List containing optional redirection decoders (other than the known Slack",
|
|
"decoder, which is enabled by `URLDispatcher.decode_slack_redir_urls` to",
|
|
"apply to URLs before dispatching them. Each list element must be a list",
|
|
"itself with a maximum of five elements:",
|
|
" * `decoder-name`: (String) a name to identify the decoder;",
|
|
" * `decoder-pattern-or-function`: (String or Function) if a string is",
|
|
" given, it is used as a [Lua pattern](https://www.lua.org/pil/20.2.html)",
|
|
" to match against the URL. If a function is given, it will be called with",
|
|
" arguments `scheme`, `host`, `params`, `fullUrl`, `senderPid` (the same",
|
|
" arguments as passed to",
|
|
" [hs.urlevent.httpCallback](https://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback)),",
|
|
" and must return a string that contains the URL to be opened. The",
|
|
" returned value will be URL-decoded according to the value of `skip-decode-url` (below).",
|
|
" * `pattern-replacement`: (String) a replacement pattern to apply if a",
|
|
" match is found when a decoder pattern (previous argument) is provided.",
|
|
" If a decoder function is given, this argument is ignored.",
|
|
" * `skip-decode-url`: (Boolean, optional) whether to skip URL-decoding of the",
|
|
" resulting string (defaults to `false`, by default URLs are always decoded)",
|
|
" * `source-application`: (String or Table, optional): a pattern or list of",
|
|
" patterns to match against the name of the application from which the URL",
|
|
" was opened. If this parameter is present, the decoder will only be",
|
|
" applied when the application matches. Default is to apply the decoder",
|
|
" regardless of the application.",
|
|
"If given as strings, `decoder-pattern-or-function` and `pattern-replacement`",
|
|
"are passed as arguments to",
|
|
"[string.gsub](https://www.lua.org/manual/5.3/manual.html#pdf-string.gsub)",
|
|
"applied on the original URL."
|
|
],
|
|
"signature": "URLDispatcher.url_redir_decoders",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
}
|
|
],
|
|
"desc": "Route URLs to different applications with pattern matching",
|
|
"doc": "Route URLs to different applications with pattern matching\n\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/URLDispatcher.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/URLDispatcher.spoon.zip)\n\nSets Hammerspoon as the default browser for HTTP/HTTPS links, and\ndispatches them to different apps according to the patterns defined\nin the config. If no pattern matches, `default_handler` is used.",
|
|
"items": [
|
|
{
|
|
"def": "URLDispatcher.decode_slack_redir_urls",
|
|
"desc": "If true, handle Slack-redir URLs to apply the rule on the destination URL. Defaults to `true`",
|
|
"doc": "If true, handle Slack-redir URLs to apply the rule on the destination URL. Defaults to `true`",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "30",
|
|
"name": "decode_slack_redir_urls",
|
|
"signature": "URLDispatcher.decode_slack_redir_urls",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.default_handler",
|
|
"desc": "Default URL handler (Defaults to `\"com.apple.Safari\"`)",
|
|
"doc": "Default URL handler (Defaults to `\"com.apple.Safari\"`)\n\nNotes:\nCan be a string containing the Bundle ID of an application, or a function\nthat takes one argument, and which will be invoked with the URL to open.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "21",
|
|
"name": "default_handler",
|
|
"notes": [
|
|
"Can be a string containing the Bundle ID of an application, or a function",
|
|
"that takes one argument, and which will be invoked with the URL to open."
|
|
],
|
|
"signature": "URLDispatcher.default_handler",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher:dispatchURL(scheme, host, params, fullUrl, senderPid)",
|
|
"desc": "Dispatch a URL to an application according to the defined `url_patterns`.",
|
|
"doc": "Dispatch a URL to an application according to the defined `url_patterns`.\n\nParameters:\n * scheme - A string containing the URL scheme (i.e. \"http\")\n * host - A string containing the host requested (e.g. \"www.hammerspoon.org\")\n * params - A table containing the key/value pairs of all the URL parameters\n * fullURL - A string containing the full, original URL. This is the only parameter used in this implementation.\n * senderPID - An integer containing the PID of the application that opened the URL, if available (otherwise -1)\n\nNotes:\n * The parameters (follow to the [httpCallback](http://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback) specification)",
|
|
"examples": [],
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "188",
|
|
"name": "dispatchURL",
|
|
"notes": [
|
|
" * The parameters (follow to the [httpCallback](http://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback) specification)"
|
|
],
|
|
"parameters": [
|
|
" * scheme - A string containing the URL scheme (i.e. \"http\")",
|
|
" * host - A string containing the host requested (e.g. \"www.hammerspoon.org\")",
|
|
" * params - A table containing the key/value pairs of all the URL parameters",
|
|
" * fullURL - A string containing the full, original URL. This is the only parameter used in this implementation.",
|
|
" * senderPID - An integer containing the PID of the application that opened the URL, if available (otherwise -1)"
|
|
],
|
|
"returns": [],
|
|
"signature": "URLDispatcher:dispatchURL(scheme, host, params, fullUrl, senderPid)",
|
|
"stripped_doc": "",
|
|
"type": "Method"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.logger",
|
|
"desc": "Logger object used within the Spoon. Can be accessed to set the default log",
|
|
"doc": "Logger object used within the Spoon. Can be accessed to set the default log\nlevel for the messages coming from the Spoon.\n\nNotes:\nExample: `spoon.URLDispatcher.logger.setLogLevel(\"debug\")`",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "99",
|
|
"name": "logger",
|
|
"notes": [
|
|
"Example: `spoon.URLDispatcher.logger.setLogLevel(\"debug\")`"
|
|
],
|
|
"signature": "URLDispatcher.logger",
|
|
"stripped_doc": "level for the messages coming from the Spoon.",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.pat_files",
|
|
"desc": "Internal variable containing a table where the pattern lists read from files are kept indexed by file name, and automatically updated.",
|
|
"doc": "Internal variable containing a table where the pattern lists read from files are kept indexed by file name, and automatically updated.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "114",
|
|
"name": "pat_files",
|
|
"signature": "URLDispatcher.pat_files",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.pat_watchers",
|
|
"desc": "Internal variable containing a table where the watchers for the pattern files are kept indexed by file name.",
|
|
"doc": "Internal variable containing a table where the watchers for the pattern files are kept indexed by file name.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "119",
|
|
"name": "pat_watchers",
|
|
"signature": "URLDispatcher.pat_watchers",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.set_system_handler",
|
|
"desc": "If true, URLDispatcher sets itself as system handler for http requests.",
|
|
"doc": "If true, URLDispatcher sets itself as system handler for http requests.\nDefaults to `true`",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "108",
|
|
"name": "set_system_handler",
|
|
"signature": "URLDispatcher.set_system_handler",
|
|
"stripped_doc": "Defaults to `true`",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher:start()",
|
|
"desc": "Start dispatching URLs according to the rules",
|
|
"doc": "Start dispatching URLs according to the rules\n\nParameters:\n * None",
|
|
"examples": [],
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "312",
|
|
"name": "start",
|
|
"notes": [],
|
|
"parameters": [
|
|
" * None"
|
|
],
|
|
"returns": [],
|
|
"signature": "URLDispatcher:start()",
|
|
"stripped_doc": "",
|
|
"type": "Method"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.url_patterns",
|
|
"desc": "URL dispatch rules.",
|
|
"doc": "URL dispatch rules.\n\nNotes:\n A table containing a list of dispatch rules. Rules are evaluated in the\n order they are declared. Each rule is a table with the following structure:\n `{ url-patterns, app-bundle-ID-or-function, function, app-patterns }`\n * `url-patterns` can be: (a) a single pattern as a string, (b) a table\n containing a list of strings, or (c) a string containing the path of a\n file from which the patterns will be read (if the string contains a valid\n filename it's used as a file, otherwise as a pattern). In case (c), a\n watcher will be set to automatically re-read the contents of the file\n when it changes. If a relative path is given (not starting with a \"/\"),\n then it is considered to be relative to the Hammerspoon configuration\n directory.\n * If `app-bundle-ID-or-function` is specified as a string, it is\n interpreted as a macOS application ID, and that application will be used\n to open matching URLs. If it is a function pointer, or not given but\n \"function\" is provided, it is expected to be a function that accepts a\n single argument, and it will be called with the URL.\n * If `app-patterns` is given, it should be a string or a table containing a\n pattern/list of patterns, and the rule will only be evaluated if the URL\n was opened from an application whose name matches one of those patterns.\n * Note that the patterns are [Lua patterns](https://www.lua.org/pil/20.2.html)\n and not regular expressions.\n * Defaults to an empty table, which has the effect of having all URLs\n dispatched to the `default_handler`.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "69",
|
|
"name": "url_patterns",
|
|
"notes": [
|
|
" A table containing a list of dispatch rules. Rules are evaluated in the",
|
|
" order they are declared. Each rule is a table with the following structure:",
|
|
" `{ url-patterns, app-bundle-ID-or-function, function, app-patterns }`",
|
|
" * `url-patterns` can be: (a) a single pattern as a string, (b) a table",
|
|
" containing a list of strings, or (c) a string containing the path of a",
|
|
" file from which the patterns will be read (if the string contains a valid",
|
|
" filename it's used as a file, otherwise as a pattern). In case (c), a",
|
|
" watcher will be set to automatically re-read the contents of the file",
|
|
" when it changes. If a relative path is given (not starting with a \"/\"),",
|
|
" then it is considered to be relative to the Hammerspoon configuration",
|
|
" directory.",
|
|
" * If `app-bundle-ID-or-function` is specified as a string, it is",
|
|
" interpreted as a macOS application ID, and that application will be used",
|
|
" to open matching URLs. If it is a function pointer, or not given but",
|
|
" \"function\" is provided, it is expected to be a function that accepts a",
|
|
" single argument, and it will be called with the URL.",
|
|
" * If `app-patterns` is given, it should be a string or a table containing a",
|
|
" pattern/list of patterns, and the rule will only be evaluated if the URL",
|
|
" was opened from an application whose name matches one of those patterns.",
|
|
" * Note that the patterns are [Lua patterns](https://www.lua.org/pil/20.2.html)",
|
|
" and not regular expressions.",
|
|
" * Defaults to an empty table, which has the effect of having all URLs",
|
|
" dispatched to the `default_handler`."
|
|
],
|
|
"signature": "URLDispatcher.url_patterns",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
},
|
|
{
|
|
"def": "URLDispatcher.url_redir_decoders",
|
|
"desc": "URL redirection decoders. Default value: empty list",
|
|
"doc": "URL redirection decoders. Default value: empty list\n\nNotes:\nList containing optional redirection decoders (other than the known Slack\ndecoder, which is enabled by `URLDispatcher.decode_slack_redir_urls` to\napply to URLs before dispatching them. Each list element must be a list\nitself with a maximum of five elements:\n * `decoder-name`: (String) a name to identify the decoder;\n * `decoder-pattern-or-function`: (String or Function) if a string is\n given, it is used as a [Lua pattern](https://www.lua.org/pil/20.2.html)\n to match against the URL. If a function is given, it will be called with\n arguments `scheme`, `host`, `params`, `fullUrl`, `senderPid` (the same\n arguments as passed to\n [hs.urlevent.httpCallback](https://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback)),\n and must return a string that contains the URL to be opened. The\n returned value will be URL-decoded according to the value of `skip-decode-url` (below).\n * `pattern-replacement`: (String) a replacement pattern to apply if a\n match is found when a decoder pattern (previous argument) is provided.\n If a decoder function is given, this argument is ignored.\n * `skip-decode-url`: (Boolean, optional) whether to skip URL-decoding of the\n resulting string (defaults to `false`, by default URLs are always decoded)\n * `source-application`: (String or Table, optional): a pattern or list of\n patterns to match against the name of the application from which the URL\n was opened. If this parameter is present, the decoder will only be\n applied when the application matches. Default is to apply the decoder\n regardless of the application.\nIf given as strings, `decoder-pattern-or-function` and `pattern-replacement`\nare passed as arguments to\n[string.gsub](https://www.lua.org/manual/5.3/manual.html#pdf-string.gsub)\napplied on the original URL.",
|
|
"file": "Source/URLDispatcher.spoon//init.lua",
|
|
"lineno": "35",
|
|
"name": "url_redir_decoders",
|
|
"notes": [
|
|
"List containing optional redirection decoders (other than the known Slack",
|
|
"decoder, which is enabled by `URLDispatcher.decode_slack_redir_urls` to",
|
|
"apply to URLs before dispatching them. Each list element must be a list",
|
|
"itself with a maximum of five elements:",
|
|
" * `decoder-name`: (String) a name to identify the decoder;",
|
|
" * `decoder-pattern-or-function`: (String or Function) if a string is",
|
|
" given, it is used as a [Lua pattern](https://www.lua.org/pil/20.2.html)",
|
|
" to match against the URL. If a function is given, it will be called with",
|
|
" arguments `scheme`, `host`, `params`, `fullUrl`, `senderPid` (the same",
|
|
" arguments as passed to",
|
|
" [hs.urlevent.httpCallback](https://www.hammerspoon.org/docs/hs.urlevent.html#httpCallback)),",
|
|
" and must return a string that contains the URL to be opened. The",
|
|
" returned value will be URL-decoded according to the value of `skip-decode-url` (below).",
|
|
" * `pattern-replacement`: (String) a replacement pattern to apply if a",
|
|
" match is found when a decoder pattern (previous argument) is provided.",
|
|
" If a decoder function is given, this argument is ignored.",
|
|
" * `skip-decode-url`: (Boolean, optional) whether to skip URL-decoding of the",
|
|
" resulting string (defaults to `false`, by default URLs are always decoded)",
|
|
" * `source-application`: (String or Table, optional): a pattern or list of",
|
|
" patterns to match against the name of the application from which the URL",
|
|
" was opened. If this parameter is present, the decoder will only be",
|
|
" applied when the application matches. Default is to apply the decoder",
|
|
" regardless of the application.",
|
|
"If given as strings, `decoder-pattern-or-function` and `pattern-replacement`",
|
|
"are passed as arguments to",
|
|
"[string.gsub](https://www.lua.org/manual/5.3/manual.html#pdf-string.gsub)",
|
|
"applied on the original URL."
|
|
],
|
|
"signature": "URLDispatcher.url_redir_decoders",
|
|
"stripped_doc": "",
|
|
"type": "Variable"
|
|
}
|
|
],
|
|
"name": "URLDispatcher",
|
|
"stripped_doc": "\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/URLDispatcher.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/URLDispatcher.spoon.zip)\n\nSets Hammerspoon as the default browser for HTTP/HTTPS links, and\ndispatches them to different apps according to the patterns defined\nin the config. If no pattern matches, `default_handler` is used.",
|
|
"submodules": [],
|
|
"type": "Module"
|
|
}
|
|
] |