Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scrapinghub/splash
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0939cff26a32bde10ea8c900622aca73bf38fba9
Choose a base ref
..
head repository: scrapinghub/splash
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f7a43dada156274792047f0053e77a3082743f17
Choose a head ref
Showing with 68 additions and 34 deletions.
  1. +58 −26 CHANGES.rst
  2. +1 −1 dockerfiles/splash-jupyter/Dockerfile
  3. +2 −1 docs/api.rst
  4. +2 −2 docs/conf.py
  5. +3 −3 docs/kernel.rst
  6. +1 −1 splash/__init__.py
  7. +1 −0 splash/tests/test_lua_parser.py
84 changes: 58 additions & 26 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Changes
=======

1.5 (2015-03-03)
----------------

In this release we introduce :ref:`Splash-Jupyter <ipython-kernel>` - a
web-based IDE for Splash Lua scripts with syntax highlighting, autocompletion
and a connected live browser window. It is implemented as a kernel for
Jupyter (IPython).

Docker images for Splash 1.5 are optimized - download size is much smaller
than in previous releases.

Other changes:

* :ref:`splash:go() <splash-go>` returned incorrect result after an
unsuccessful splash:go() call - this is fixed;
* Lua ``main`` function can now return multiple results;
* there are testing improvements and internal cleanups.


1.4 (2015-02-10)
----------------

@@ -12,10 +31,11 @@ From version 1.4 Splash requires Pillow (built with PNG support) to work.

There are backwards-incompatible changes in Splash scripts:

* splash:set_viewport() is split into splash:set_viewport_size()
and splash:set_viewport_full();
* old splash:runjs() method is renamed to splash:evaljs();
* new splash:runjs() method just runs JavaScript code
* splash:set_viewport() is split into
:ref:`splash:set_viewport_size() <splash-set-viewport-size>`
and :ref:`splash:set_viewport_full() <splash-set-viewport-full>`;
* old splash:runjs() method is renamed to :ref:`splash:evaljs() <splash-evaljs>`;
* new :ref:`splash:runjs <splash-runjs>` method just runs JavaScript code
without returning the result of the last JS statement.

To upgrade check all splash:runjs() usages: if the returned result is used
@@ -27,29 +47,41 @@ New scripting features:

* it is now possible to write custom Lua plugins stored server-side;
* a restricted version of Lua ``require`` is enabled in sandbox;
* splash:autoload() method for setting JS to load on each request;
* splash:wait_for_resume() method for interacting with async JS code;
* splash:lock_navigation() and splash:unlock_navigation() methods;
* splash:set_viewport() is split into splash:set_viewport_size()
and splash:set_viewport_full();
* splash:get_viewport_size() method;
* splash:http_get() method for sending HTTP GET requests without loading result
to the browser;
* splash:set_content() method for setting page content from a string;
* splash:get_cookies(), splash:add_cookie(), splash:clear_cookies(),
splash:delete_cookies() and splash:init_cookies() methods for working
* :ref:`splash:autoload() <splash-autoload>` method for setting JS to load
on each request;
* :ref:`splash:wait_for_resume() <splash-wait-for-resume>` method for
interacting with async JS code;
* :ref:`splash:lock_navigation() <splash-lock-navigation>` and
:ref:`splash:unlock_navigation() <splash-unlock-navigation>` methods;
* splash:set_viewport() is split into
:ref:`splash:set_viewport_size() <splash-set-viewport-size>`
and :ref:`splash:set_viewport_full() <splash-set-viewport-full>`;
* :ref:`splash:get_viewport_size() <splash-get-viewport-size>` method;
* :ref:`splash:http_get() <splash-http-get>` method for sending HTTP GET
requests without loading result to the browser;
* :ref:`splash:set_content() <splash-set-content>` method for setting
page content from a string;
* :ref:`splash:get_cookies() <splash-get-cookies>`,
:ref:`splash:add_cookie() <splash-add-cookie>`,
:ref:`splash:clear_cookies() <splash-clear-cookies>`,
:ref:`splash:delete_cookies() <splash-delete-cookies>` and
:ref:`splash:init_cookies() <splash-init-cookies>` methods for working
with cookies;
* splash:set_user_agent() method for setting User-Agent header;
* splash:set_custom_headers() method for setting other HTTP headers;
* splash:url() method for getting current URL;
* splash:go() now accepts ``headers`` argument;
* splash:evaljs() method, which is a splash:runjs() from Splash v1.3.1
with improved error handling (it raises an error in case of JavaScript
exceptions);
* splash:runjs() method no longer returns the result of last computation;
* splash:runjs() method handles JavaScript errors by returning ``ok, error``
pair;
* splash:get_perf_stats() command for getting Splash resource usage.
* :ref:`splash:set_user_agent() <splash-set-user-agent>` method for
setting User-Agent header;
* :ref:`splash:set_custom_headers() <splash-set-custom-headers>` method for
setting other HTTP headers;
* :ref:`splash:url() <splash-url>` method for getting current URL;
* :ref:`splash:go() <splash-go>` now accepts ``headers`` argument;
* :ref:`splash:evaljs() <splash-evaljs>` method, which is a
splash:runjs() from Splash v1.3.1 with improved error handling
(it raises an error in case of JavaScript exceptions);
* :ref:`splash:runjs() <splash-runjs>` method no longer returns the result
of last computation;
* :ref:`splash:runjs() <splash-runjs>` method handles JavaScript errors
by returning ``ok, error`` pair;
* :ref:`splash:get_perf_stats() <splash-get-perf-stats>` method for
getting Splash resource usage.

Other improvements:

2 changes: 1 addition & 1 deletion dockerfiles/splash-jupyter/Dockerfile
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ RUN add-apt-repository -y ppa:chris-lea/zeromq && \
libzmq3-dev \
libsqlite3-dev && \
/usr/local/bin/pip install --no-cache-dir \
ipython[notebook]==3.0.0rc1 && \
ipython[notebook]==3.0.0 && \
apt-get remove -y --purge \
python-dev \
build-essential \
3 changes: 2 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
@@ -57,7 +57,8 @@ wait : float : optional
setInterval/setTimeout javascript calls, because with wait=0
callbacks of setInterval/setTimeout won't be executed. Non-zero
:ref:`wait <arg-wait>` is also required for PNG rendering when doing
full-page rendering (see :ref:`render_all <arg-render-all>`).
full-page rendering (see :ref:`render_all <arg-render-all>`). Maximum
allowed value for wait is 10 seconds.

.. _arg-proxy:

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -51,9 +51,9 @@
# built documents.
#
# The short X.Y version.
version = '1.4'
version = '1.5'
# The full version, including alpha/beta/rc tags.
release = '1.4'
release = '1.5'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
6 changes: 3 additions & 3 deletions docs/kernel.rst
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ To install Splash-Jupyter using Docker, run::

Then start the container::

$ docker run -p 8888:8888 -it splash-jupyter
$ docker run -p 8888:8888 -it scrapinghub/splash-jupyter

.. note::

@@ -46,9 +46,9 @@ Currently to enable live Webkit window you must install Splash
in a "manual way" - see :ref:`manual-install-ubuntu`.

1. Install IPython/Jupyter with notebook feature. Splash kernel requires
IPython >= 3.0.0rc1. This should work if IPython 3.x is not released yet::
IPython 3.x::

$ pip install ipython[notebook] --pre
$ pip install 'ipython[notebook] >= 3.0.0'

2. Let IPython know about Splash kernel by running the following command::

2 changes: 1 addition & 1 deletion splash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.4'
__version__ = '1.5'

from distutils.version import LooseVersion
version_info = tuple(LooseVersion(__version__).version)
1 change: 1 addition & 0 deletions splash/tests/test_lua_parser.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import functools

import pytest
lupa = pytest.importorskip("lupa")

from splash.kernel.lua_parser import (
Standalone,