* client-side rewrite: fix extract_orig() to unrewrite relative urls using current page scheme, don't default to http
* wombat tests: fix karma tests by adding 'wombat_scheme' to test setup
wombat.js:
- Finalized PreserveWorker that preserves srcset values and Media Query values
- Defered extraction and preservation of the values to be preserved so that the UI thread is not clobered
- Hooked into places where wombat rewrites the values we are interested in
wombatPreservationWorker.js:
- Updated handling of srcset extraction now that we are sending wombat srcset rewrites
- Added check to see if we have seen a URL to be fetched
- Added light polyfill of Promise and fetch if they are not defined in wombatPreservationWorker.js, for safari
wombat.spec.js
- Updated to include values necessary to work with PWorker changes.
The values returned by getting the 'href' and 'toString'
properties of an anchor element should be the same.
This inconsistency broke the URL polyfill in
https://github.com/inexorabletash/polyfill under Microsoft Edge
* Increase the default timeouts to account for the relative
slowness of setting up connections to remote browsers.
* Change the URL into which Wombat JS is loaded for
tests to be a valid URL. Under Microsoft Edge, the JS
code in the page is not run if the URL fetch returns a 404.
* Change assert.equal() implementation to avoid confusion due
to Karma's reformatting of URLs in exception error messages.
Wombat overrides document.baseURI and <base>.href in order
to return the original URL rather than the proxied URL.
The <base>.href override however ended up making a writable
attribute read-only, which could trigger script errors
in strict-mode JS.
Fix this by avoiding replacing the setter for a DOM property
if no replacement setter is provided.
Fixes an error loading Hypothesis under Microsoft Edge.
Detect in the test whether overriding of DOM properties
is supported in the current environment and skip testing
for the baseURI override in that case.
This gives us the capability to test the client-side JS
rewriting against a suite of different browsers on different
platforms.
Note that getting Karma running on Travis CI requires some
additional configuration documented at
github.com/karma-runner/karma-sauce-launcher/issues/73
which is not made clear in the original documentation.
In order to run the Karma tests, the Sauce Labs username
and access keys need to be passed in via the SAUCE_USERNAME
and SAUCE_ACCESS_KEYS env vars.
* Add a Karma configuration for unit/integration tests
for the client-side pywb code.
* Add an integration test suite which creates an <iframe> loads
the client-side rewriting code (wombat.js) in it and
then executes a test script.
Since wombat.js monkey-patches the DOM and the exact behavior
of DOM objects varies between browsers, which we want to test,
the suite does not mock the DOM but instead runs
a set of tests in an isolated environment against
the DOM.
* Add Travis config to run the Karma tests