Skip to content

Commit

Permalink
splash-jupyter: update inspections file
Browse files Browse the repository at this point in the history
  • Loading branch information
kmike committed Aug 16, 2019
1 parent 6105d79 commit a1f4488
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions splash/kernel/inspections/splash-auto.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,23 @@
"splash.media_source_enabled": {
"name": null,
"header": "splash.media_source_enabled",
"content": "Enable or disable `Media Source Extensions API`_.\n\n**Signature:** ``splash.media_source_enabled = true/false``\n\nMedia Source is enabled by default. Use ``splash.media_source_enabled = false``\nto disable it.\n\n.. _Media Source Extensions API: https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API\n\nMethods\n~~~~~~~",
"content": "Enable or disable `Media Source Extensions API`_.\n\n**Signature:** ``splash.media_source_enabled = true/false``\n\nMedia Source is enabled by default. Use ``splash.media_source_enabled = false``\nto disable it.\n\n.. _Media Source Extensions API: https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API",
"short": "Enable or disable `Media Source Extensions API`_.",
"signature": "splash.media_source_enabled = true/false",
"returns": null,
"async": null,
"details": "Media Source is enabled by default. Use ``splash.media_source_enabled = false``\nto disable it.\n\n.. _Media Source Extensions API: https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API\n\nMethods\n~~~~~~~",
"details": "Media Source is enabled by default. Use ``splash.media_source_enabled = false``\nto disable it.\n\n.. _Media Source Extensions API: https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API",
"params": null
},
"splash.http2_enabled": {
"name": null,
"header": "splash.http2_enabled",
"content": "Enable or disable HTTP2.\n\n**Signature:** ``splash.http2_enabled = true/false``\n\nHTTP2 is enabled by default. Use ``splash.http2_enabled = false`` to disable it.\nDisabling HTTP2 can be useful either for testing, or when http2 causes problems\n(e.g. try disabling http2 if you're getting network399 errors).\n\nMethods\n~~~~~~~",
"short": "Enable or disable HTTP2.",
"signature": "splash.http2_enabled = true/false",
"returns": null,
"async": null,
"details": "HTTP2 is enabled by default. Use ``splash.http2_enabled = false`` to disable it.\nDisabling HTTP2 can be useful either for testing, or when http2 causes problems\n(e.g. try disabling http2 if you're getting network399 errors).\n\nMethods\n~~~~~~~",
"params": null
},
"splash:go": {
Expand All @@ -156,8 +167,8 @@
"splash:wait": {
"name": "wait",
"header": "splash:wait",
"content": "Wait for ``time`` seconds. When script is waiting WebKit continues\nprocessing the webpage.\n\n**Signature:** ``ok, reason = splash:wait{time, cancel_on_redirect=false, cancel_on_error=true}``\n\n**Parameters:**\n\n* time - time to wait, in seconds;\n* cancel_on_redirect - if true (not a default) and a redirect\n happened while waiting, then ``splash:wait`` stops earlier and returns\n ``nil, \"redirect\"``. Redirect could be initiated by\n ``<meta http-equiv=\"refresh\" ...>`` HTML tags or by JavaScript code.\n* cancel_on_error - if true (default) and an error which prevents page\n from being rendered happened while waiting (e.g. an internal WebKit error\n or a network error like a redirect to a non-resolvable host)\n then ``splash:wait`` stops earlier and returns ``nil, \"<error string>\"``.\n\n**Returns:** ``ok, reason`` pair. If ``ok`` is ``nil`` then the timer was\nstopped prematurely, and ``reason`` contains a string with a reason.\n\n**Async:** yes.\n\nUsage example:\n\n.. code-block:: lua\n\n -- go to example.com, wait 0.5s, return rendered html, ignore all errors.\n function main(splash)\n splash:go(\"http://example.com\")\n splash:wait(0.5)\n return {html=splash:html()}\n end\n\nBy default wait timer continues to tick when redirect happens.\n``cancel_on_redirect`` option can be used to restart the timer after\neach redirect. For example, here is a function that waits for a given\ntime after each page load in case of redirects:\n\n.. code-block:: lua\n\n function wait_restarting_on_redirects(splash, time, max_redirects)\n local redirects_remaining = max_redirects\n while redirects_remaining > 0 do\n local ok, reason = self:wait{time=time, cancel_on_redirect=true}\n if reason ~= 'redirect' then\n return ok, reason\n end\n redirects_remaining = redirects_remaining - 1\n end\n return nil, \"too_many_redirects\"\n end",
"short": "Wait for ``time`` seconds. When script is waiting WebKit continues\nprocessing the webpage.",
"content": "Wait for ``time`` seconds. When script is waiting browser continues\nprocessing the webpage.\n\n**Signature:** ``ok, reason = splash:wait{time, cancel_on_redirect=false, cancel_on_error=true}``\n\n**Parameters:**\n\n* time - time to wait, in seconds;\n* cancel_on_redirect - if true (not a default) and a redirect\n happened while waiting, then ``splash:wait`` stops earlier and returns\n ``nil, \"redirect\"``. Redirect could be initiated by\n ``<meta http-equiv=\"refresh\" ...>`` HTML tags or by JavaScript code.\n* cancel_on_error - if true (default) and an error which prevents page\n from being rendered happened while waiting (e.g. an internal WebKit error\n or a network error like a redirect to a non-resolvable host)\n then ``splash:wait`` stops earlier and returns ``nil, \"<error string>\"``.\n\n**Returns:** ``ok, reason`` pair. If ``ok`` is ``nil`` then the timer was\nstopped prematurely, and ``reason`` contains a string with a reason.\n\n**Async:** yes.\n\nUsage example:\n\n.. code-block:: lua\n\n -- go to example.com, wait 0.5s, return rendered html, ignore all errors.\n function main(splash)\n splash:go(\"http://example.com\")\n splash:wait(0.5)\n return {html=splash:html()}\n end\n\nBy default wait timer continues to tick when redirect happens.\n``cancel_on_redirect`` option can be used to restart the timer after\neach redirect. For example, here is a function that waits for a given\ntime after each page load in case of redirects:\n\n.. code-block:: lua\n\n function wait_restarting_on_redirects(splash, time, max_redirects)\n local redirects_remaining = max_redirects\n while redirects_remaining > 0 do\n local ok, reason = self:wait{time=time, cancel_on_redirect=true}\n if reason ~= 'redirect' then\n return ok, reason\n end\n redirects_remaining = redirects_remaining - 1\n end\n return nil, \"too_many_redirects\"\n end",
"short": "Wait for ``time`` seconds. When script is waiting browser continues\nprocessing the webpage.",
"signature": "ok, reason = splash:wait{time, cancel_on_redirect=false, cancel_on_error=true}",
"returns": "``ok, reason`` pair. If ``ok`` is ``nil`` then the timer was\nstopped prematurely, and ``reason`` contains a string with a reason.",
"async": "yes.",
Expand Down Expand Up @@ -211,12 +222,12 @@
"splash:autoload": {
"name": "autoload",
"header": "splash:autoload",
"content": "Set JavaScript to load automatically on each page load.\n\n**Signature:** ``ok, reason = splash:autoload{source_or_url, source=nil, url=nil}``\n\n**Parameters:**\n\n* source_or_url - either a string with JavaScript source code or an URL\n to load the JavaScript code from;\n* source - a string with JavaScript source code;\n* url - an URL to load JavaScript source code from.\n\n**Returns:** ``ok, reason`` pair. If ``ok`` is nil, error happened and\n``reason`` contains an error description.\n\n**Async:** yes, but only when an URL of a remote resource is passed.\n\n:ref:`splash-autoload` allows to execute JavaScript code at each page load.\n:ref:`splash-autoload` doesn't doesn't execute the passed\nJavaScript code itself. To execute some code once, *after* page is loaded\nuse :ref:`splash-runjs` or :ref:`splash-jsfunc`.\n\n:ref:`splash-autoload` can be used to preload utility JavaScript libraries\nor replace JavaScript objects before a webpage has a chance to do it.\n\nExample:\n\nfunction main(splash, args)\n splash:autoload([[\n function get_document_title(){\n return document.title;\n }\n ]])\n assert(splash:go(args.url))\n\n return splash:evaljs(\"get_document_title()\")\nend\nFor the convenience, when a first :ref:`splash-autoload` argument starts\nwith \"http://\" or \"https://\" a script from the passed URL is loaded.\nExample 2 - make sure a remote library is available:\n\nfunction main(splash, args)\n assert(splash:autoload(\"https://code.jquery.com/jquery-2.1.3.min.js\"))\n assert(splash:go(splash.args.url))\n local version = splash:evaljs(\"$.fn.jquery\")\n\n return 'JQuery version: ' .. version\nend\n\nTo disable URL auto-detection use 'source' and 'url' arguments:\n\n.. code-block:: lua\n\n splash:autoload{url=\"https://code.jquery.com/jquery-2.1.3.min.js\"}\n splash:autoload{source=\"window.foo = 'bar';\"}\n\nIt is a good practice not to rely on auto-detection when the argument\nis not a constant.\n\nIf :ref:`splash-autoload` is called multiple times then all its scripts\nare executed on page load, in order they were added.\n\nTo revert Splash not to execute anything on page load use\n:ref:`splash-autoload-reset`.\n\nSee also: :ref:`splash-evaljs`, :ref:`splash-runjs`, :ref:`splash-jsfunc`,\n:ref:`splash-wait-for-resume`, :ref:`splash-autoload-reset`.",
"content": "Set JavaScript to load automatically on each page load.\n\n**Signature:** ``ok, reason = splash:autoload{source_or_url, source=nil, url=nil}``\n\n**Parameters:**\n\n* source_or_url - either a string with JavaScript source code or an URL\n to load the JavaScript code from;\n* source - a string with JavaScript source code;\n* url - an URL to load JavaScript source code from.\n\n**Returns:** ``ok, reason`` pair. If ``ok`` is nil, error happened and\n``reason`` contains an error description.\n\n**Async:** yes, but only when an URL of a remote resource is passed.\n\n:ref:`splash-autoload` allows to execute JavaScript code at each page load.\n:ref:`splash-autoload` doesn't execute the passed\nJavaScript code itself. To execute some code once, *after* page is loaded\nuse :ref:`splash-runjs` or :ref:`splash-jsfunc`.\n\n:ref:`splash-autoload` can be used to preload utility JavaScript libraries\nor replace JavaScript objects before a webpage has a chance to do it.\n\nExample:\n\nfunction main(splash, args)\n splash:autoload([[\n function get_document_title(){\n return document.title;\n }\n ]])\n assert(splash:go(args.url))\n\n return splash:evaljs(\"get_document_title()\")\nend\nFor the convenience, when a first :ref:`splash-autoload` argument starts\nwith \"http://\" or \"https://\" a script from the passed URL is loaded.\nExample 2 - make sure a remote library is available:\n\nfunction main(splash, args)\n assert(splash:autoload(\"https://code.jquery.com/jquery-2.1.3.min.js\"))\n assert(splash:go(splash.args.url))\n local version = splash:evaljs(\"$.fn.jquery\")\n\n return 'JQuery version: ' .. version\nend\n\nTo disable URL auto-detection use 'source' and 'url' arguments:\n\n.. code-block:: lua\n\n splash:autoload{url=\"https://code.jquery.com/jquery-2.1.3.min.js\"}\n splash:autoload{source=\"window.foo = 'bar';\"}\n\nIt is a good practice not to rely on auto-detection when the argument\nis not a constant.\n\nIf :ref:`splash-autoload` is called multiple times then all its scripts\nare executed on page load, in order they were added.\n\nTo revert Splash not to execute anything on page load use\n:ref:`splash-autoload-reset`.\n\nSee also: :ref:`splash-evaljs`, :ref:`splash-runjs`, :ref:`splash-jsfunc`,\n:ref:`splash-wait-for-resume`, :ref:`splash-autoload-reset`.",
"short": "Set JavaScript to load automatically on each page load.",
"signature": "ok, reason = splash:autoload{source_or_url, source=nil, url=nil}",
"returns": "``ok, reason`` pair. If ``ok`` is nil, error happened and\n``reason`` contains an error description.",
"async": "yes, but only when an URL of a remote resource is passed.",
"details": ":ref:`splash-autoload` allows to execute JavaScript code at each page load.\n:ref:`splash-autoload` doesn't doesn't execute the passed\nJavaScript code itself. To execute some code once, *after* page is loaded\nuse :ref:`splash-runjs` or :ref:`splash-jsfunc`.\n\n:ref:`splash-autoload` can be used to preload utility JavaScript libraries\nor replace JavaScript objects before a webpage has a chance to do it.\n\nExample:\n\nfunction main(splash, args)\n splash:autoload([[\n function get_document_title(){\n return document.title;\n }\n ]])\n assert(splash:go(args.url))\n\n return splash:evaljs(\"get_document_title()\")\nend\nFor the convenience, when a first :ref:`splash-autoload` argument starts\nwith \"http://\" or \"https://\" a script from the passed URL is loaded.\nExample 2 - make sure a remote library is available:\n\nfunction main(splash, args)\n assert(splash:autoload(\"https://code.jquery.com/jquery-2.1.3.min.js\"))\n assert(splash:go(splash.args.url))\n local version = splash:evaljs(\"$.fn.jquery\")\n\n return 'JQuery version: ' .. version\nend\n\nTo disable URL auto-detection use 'source' and 'url' arguments:\n\n.. code-block:: lua\n\n splash:autoload{url=\"https://code.jquery.com/jquery-2.1.3.min.js\"}\n splash:autoload{source=\"window.foo = 'bar';\"}\n\nIt is a good practice not to rely on auto-detection when the argument\nis not a constant.\n\nIf :ref:`splash-autoload` is called multiple times then all its scripts\nare executed on page load, in order they were added.\n\nTo revert Splash not to execute anything on page load use\n:ref:`splash-autoload-reset`.\n\nSee also: :ref:`splash-evaljs`, :ref:`splash-runjs`, :ref:`splash-jsfunc`,\n:ref:`splash-wait-for-resume`, :ref:`splash-autoload-reset`.",
"details": ":ref:`splash-autoload` allows to execute JavaScript code at each page load.\n:ref:`splash-autoload` doesn't execute the passed\nJavaScript code itself. To execute some code once, *after* page is loaded\nuse :ref:`splash-runjs` or :ref:`splash-jsfunc`.\n\n:ref:`splash-autoload` can be used to preload utility JavaScript libraries\nor replace JavaScript objects before a webpage has a chance to do it.\n\nExample:\n\nfunction main(splash, args)\n splash:autoload([[\n function get_document_title(){\n return document.title;\n }\n ]])\n assert(splash:go(args.url))\n\n return splash:evaljs(\"get_document_title()\")\nend\nFor the convenience, when a first :ref:`splash-autoload` argument starts\nwith \"http://\" or \"https://\" a script from the passed URL is loaded.\nExample 2 - make sure a remote library is available:\n\nfunction main(splash, args)\n assert(splash:autoload(\"https://code.jquery.com/jquery-2.1.3.min.js\"))\n assert(splash:go(splash.args.url))\n local version = splash:evaljs(\"$.fn.jquery\")\n\n return 'JQuery version: ' .. version\nend\n\nTo disable URL auto-detection use 'source' and 'url' arguments:\n\n.. code-block:: lua\n\n splash:autoload{url=\"https://code.jquery.com/jquery-2.1.3.min.js\"}\n splash:autoload{source=\"window.foo = 'bar';\"}\n\nIt is a good practice not to rely on auto-detection when the argument\nis not a constant.\n\nIf :ref:`splash-autoload` is called multiple times then all its scripts\nare executed on page load, in order they were added.\n\nTo revert Splash not to execute anything on page load use\n:ref:`splash-autoload-reset`.\n\nSee also: :ref:`splash-evaljs`, :ref:`splash-runjs`, :ref:`splash-jsfunc`,\n:ref:`splash-wait-for-resume`, :ref:`splash-autoload-reset`.",
"params": "* source_or_url - either a string with JavaScript source code or an URL\n to load the JavaScript code from;\n* source - a string with JavaScript source code;\n* url - an URL to load JavaScript source code from."
},
"splash:autoload_reset": {
Expand Down Expand Up @@ -596,12 +607,12 @@
"splash:get_version": {
"name": "get_version",
"header": "splash:get_version",
"content": "Get Splash major and minor version.\n\n**Signature:** ``version_info = splash:get_version()``\n\n**Returns:** A table with version information.\n\n**Async:** no.\n\nAs of now, this table contains:\n\n* ``splash`` - (string) Splash version\n* ``major`` - (int) Splash major version\n* ``minor`` - (int) Splash minor version\n* ``python`` - (string) Python version\n* ``qt`` - (string) Qt version\n* ``pyqt`` - (string) PyQt version\n* ``webkit`` - (string) WebKit version\n* ``sip`` - (string) SIP version\n* ``twisted`` - (string) Twisted version\n\nExample:\n\n.. code-block:: lua\n\n function main(splash)\n local version = splash:get_version()\n if version.major < 2 and version.minor < 8 then\n error(\"Splash 1.8 or newer required\")\n end\n end",
"content": "Get Splash major and minor version.\n\n**Signature:** ``version_info = splash:get_version()``\n\n**Returns:** A table with version information.\n\n**Async:** no.\n\nAs of now, this table contains:\n\n* ``splash`` - (string) Splash version\n* ``major`` - (int) Splash major version\n* ``minor`` - (int) Splash minor version\n* ``python`` - (string) Python version\n* ``qt`` - (string) Qt version\n* ``pyqt`` - (string) PyQt version\n* ``webkit`` - (string) WebKit version\n* ``chromium`` - (string) Chromium version\n* ``sip`` - (string) SIP version\n* ``twisted`` - (string) Twisted version\n\nExample:\n\n.. code-block:: lua\n\n function main(splash)\n local version = splash:get_version()\n if version.major < 2 and version.minor < 8 then\n error(\"Splash 1.8 or newer required\")\n end\n end",
"short": "Get Splash major and minor version.",
"signature": "version_info = splash:get_version()",
"returns": "A table with version information.",
"async": "no.",
"details": "As of now, this table contains:\n\n* ``splash`` - (string) Splash version\n* ``major`` - (int) Splash major version\n* ``minor`` - (int) Splash minor version\n* ``python`` - (string) Python version\n* ``qt`` - (string) Qt version\n* ``pyqt`` - (string) PyQt version\n* ``webkit`` - (string) WebKit version\n* ``sip`` - (string) SIP version\n* ``twisted`` - (string) Twisted version\n\nExample:\n\n.. code-block:: lua\n\n function main(splash)\n local version = splash:get_version()\n if version.major < 2 and version.minor < 8 then\n error(\"Splash 1.8 or newer required\")\n end\n end",
"details": "As of now, this table contains:\n\n* ``splash`` - (string) Splash version\n* ``major`` - (int) Splash major version\n* ``minor`` - (int) Splash minor version\n* ``python`` - (string) Python version\n* ``qt`` - (string) Qt version\n* ``pyqt`` - (string) PyQt version\n* ``webkit`` - (string) WebKit version\n* ``chromium`` - (string) Chromium version\n* ``sip`` - (string) SIP version\n* ``twisted`` - (string) Twisted version\n\nExample:\n\n.. code-block:: lua\n\n function main(splash)\n local version = splash:get_version()\n if version.major < 2 and version.minor < 8 then\n error(\"Splash 1.8 or newer required\")\n end\n end",
"params": null
},
"splash:mouse_click": {
Expand Down

0 comments on commit a1f4488

Please sign in to comment.