1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-21 11:02:10 +01:00

471 Commits

Author SHA1 Message Date
Ilya Kreymer
95a212ed79 wombat rewrite: add custom X-Pywb-Requested-With header with turns off rewriting and is never sent upstream 2016-04-06 12:05:53 -07:00
Ilya Kreymer
63f44cbc26 wombat: bump version to 2.11 2016-03-20 22:54:27 -07:00
Ilya Kreymer
4b8bbb7b40 wombat: fix typo in window.Crypto check! 2016-03-20 22:51:39 -07:00
Ilya Kreymer
d2390ee809 wombat: add check for window.crypto, generate 32-bit values 2016-03-20 22:43:05 -07:00
Ilya Kreymer
08cb02c644 wombat: override window.crypto.getRandomValues() with seeded random 2016-03-20 18:50:45 -07:00
Ilya Kreymer
c76aa17b78 wb.js: pad timestamp to 14 digits 2016-02-25 18:25:28 -08:00
Ilya Kreymer
98843a2551 wombat: call reload() on actual location, possible fix related to #164 2015-12-29 16:17:39 -08:00
Ilya Kreymer
0cf6b40af9 wombat: add option to def_prop() to make overriden property enumerable, make WombatLocation and other loc overrides enumerable, fixes #163 2015-12-18 21:46:50 -08:00
Ilya Kreymer
79b35a64b3 bump wombat version to 2.10 2015-12-13 00:31:01 -08:00
Ilya Kreymer
64fe49d703 wombat: add CSSStyleSheet.prototype href override
karma tests: change name to just 'pywb'
2015-12-11 17:33:22 -08:00
Robert Knight
34721a6742 Override HTMLAnchorElement.prototype.toString()
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
2015-12-02 20:09:09 +00:00
Robert Knight
977647cea9 Override the baseURI property on the correct object
baseURI is a property of Node.prototype
in current browsers and should be overridden there,
except for Safari where it cannot be overridden at all.
2015-11-26 17:09:26 +00:00
Robert Knight
1484b06da6 Avoid changing the writability of the 'href' attr of <base>
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.
2015-11-26 13:54:47 +00:00
Robert Knight
f2fdbcc511 Lookup baseURI getter on Node.prototype, not Node
Fix regression in baseURI override, spotted by the Karma
tests.

The getter should be looked up on Node.prototype, not Node.
2015-11-26 10:00:09 +00:00
Ilya Kreymer
cd2390333a Merge pull request #153 from robertknight/safari-dom-fixes
Fix Wombat in Safari 9
2015-11-26 01:15:30 -08:00
Robert Knight
5208117299 Fix Wombat in Safari 9
In Safari 9, Object.getOwnPropertyDescriptor(domObject.prototype, prop)
returns descriptors which have the correct structure but undefined
getters and are marked as unconfigurable.

See https://bugs.webkit.org/show_bug.cgi?id=49739#c19
for details. The getters cannot be retrieved via obj.__lookupGetter__()
either.

 * Resolve the issue by skipping overrides for DOM properties
   where the property is not configurable, or the original getter for
   a property could not be retrieved.

 * Lookup the 'baseURI' property on the correct prototype (Node,
   not document)

This fix also resolves the problem where accesses to document.baseURI
on Edge would fail.
2015-11-25 16:52:11 +00:00
Ilya Kreymer
dc74b14af0 iframe scrolling: use webkit scrollbars for better scrolling iframes due to osx chrome iframe bug
scrollbar now fully functional, though some artifacts still appear #93
2015-10-31 12:06:01 -07:00
Ilya Kreymer
f3c87c1786 wombat: additional checks for cross-frame top frame access, #137 2015-10-21 10:54:48 -07:00
Ilya Kreymer
8b68119994 wombat: use wb_rel_prefix instead of wbinfo.coll for rel prefix path 2015-10-17 08:53:01 -07:00
Ilya Kreymer
42091fd36e wombat: fix typo which caused rewrite_style() to be skipped unless style started with url prefix! 2015-10-14 17:36:33 -07:00
Ilya Kreymer
edbfd500a4 wombat: fix rel '/' rewrite which incorrectly handles rel scheme '//' urls 2015-10-12 22:13:26 -07:00
Ilya Kreymer
8b7516708d wombat: improved rewrite when running at root: fixes for extract_orig and /-rel rewrite
move init to be before proxy check
2015-10-11 23:16:15 -07:00
Ilya Kreymer
4dfe187174 proxy improvements:
use proxy_magic path to get video info to ensure video info, addresses #106
video info: ensure vi_ replay has CORS support to support serving from magic path
proxy & wombat improvements: set replay_top to window.top and avoid causing cross-domain errors
2015-10-11 21:03:30 -07:00
Ilya Kreymer
9a19265786 rewrite: disable 'integrity' (as well as crossorigin) attr due to rewriting, which modifies the resource 2015-10-05 23:04:56 -07:00
Ilya Kreymer
46a8cb5132 wombat: fix typo! 2015-10-02 12:22:42 -07:00
Ilya Kreymer
3d7a3fb9ef wombat: fix change test bool logic typos 2015-09-24 21:33:13 -07:00
Ilya Kreymer
87d7fb11ca wombat improvements:
* detect if anything actually rewritten in rewrite_html(), skip write()/writeln() override if no changes
* for relative ./ or ../ rewrite, find trailing slash
* better window detection instead of instanceof Window (using constructor and window prop check)
* bump to wombat 2.9
2015-09-24 21:10:06 -07:00
Ilya Kreymer
a45464cc61 wombat: fix form action overrides 2015-09-20 11:49:04 -07:00
Ilya Kreymer
589eb6513c wombat: related to #129, resolve any dynamic urls with a "." or ".." relative to original url, avoiding break rewrite url 2015-09-14 19:23:44 -07:00
Ilya Kreymer
c96082cf83 wobmat rewrite: support "a.href = '.'" properly even if trailing / missing 2015-09-10 17:18:30 -07:00
Ilya Kreymer
08849a573b wombat: better detection of top replay frame when in 'non-frame container' mode
avoids banner being accidentally added to inner frames!
2015-09-10 17:13:53 -07:00
Ilya Kreymer
26ed3aaecd vidrw: further fix for #126 for browsers w/o mutationobserver support (e.g. safari) 2015-09-08 12:16:30 -07:00
Ilya Kreymer
6d25df2beb vidrw: fix for vimeo videos that were broken due to turning off of javascript url rewriting.
videos recorded via youtube-dl path may attempt to be replayed as default html5
for vimeo path, add a placeholder <embed> to trigger old lookup path if no videos are loaded.
fixes #126
2015-09-08 11:51:37 -07:00
Ilya Kreymer
78c3a34598 wombat: style rewrite regex to be case-insensitive 2015-09-04 10:53:14 -07:00
Ilya Kreymer
c16ac4b127 wombat: rewrite dynamically added OBJECT[data] if data is a full url, add proto override (though only supported in FF) 2015-09-04 08:52:51 -07:00
Ilya Kreymer
fecf1a73e8 wombat: ensure setAttribute "style" is rewritten as a style 2015-09-04 08:19:32 -07:00
Ilya Kreymer
d0b3b0d7ae rewrite: wombat: rewrite document.writeln 2015-09-03 15:32:24 -07:00
Ilya Kreymer
ddcd03f1fc wombat: cache partial tag document.write() calls, eg. document.write("<scr"), document.write("ipt>") and parse and write full tag.
(detect if no tags added, not 100% fool-proof but covers common cases at this point)
2015-09-02 05:36:34 -07:00
Ilya Kreymer
8d1823c1c2 wombat: don't log iframe.contentWindow access exception, safely ignorable 2015-08-15 15:51:53 -07:00
Ilya Kreymer
1aa273340c wombat: when handling document.write() html rewrite, remove end-tag if not present in initial html
attr override: don't call setAttribute() by default
2015-08-15 11:28:42 -07:00
Ilya Kreymer
2f3e740279 fix typo 2015-08-14 22:33:32 -07:00
Ilya Kreymer
e56b738652 wombat improvements:
cookie rewrite: properly escape ',' in expires before splitting by comma, use reaplce function
to correctly replace path and domain
form override: add explicit overrides to all form.actions, add override to createElement()
as form.action override is not always prototype-overridable
textContent: add style element textContent override
add registerProtocolHandler override
2015-08-14 22:27:01 -07:00
Ilya Kreymer
3ef5d98bc6 bump to 0.10.7-dev
wombat: use Document.prototpe for cookie getter and setter if not found on
document object, add no-op setter for document.domain
tests: fix test to avoid including line ending
2015-08-09 09:25:02 -07:00
Ilya Kreymer
8ab342c4ca wombat: actually enable style overrides, use CSS2Declaration for FF, keep old rule in place for now 2015-08-09 00:14:26 -07:00
Ilya Kreymer
5d9081e5d9 wb_frame: add init_pm() which overrides postMessage on outerframe, allows for proxying postMessages to and from actual parent when running in embedded mode #125 2015-08-08 23:22:13 -07:00
Ilya Kreymer
4b4d7bbc27 wombat: improved style rewriting: override CSSStyleDeclaration params directly to avoid mutation observers,
document.write: override text content of <style> elements, and newly appended Text content added as children
rules: disable special cases rules no longer needed due to improved css rewriting
2015-08-08 23:19:43 -07:00
Ilya Kreymer
fbe91adf5e wombat: add support for specifying custom modifier for rewrite_url, specify custom mod for attr overrides and setAttribute 2015-08-08 15:53:13 -07:00
Ilya Kreymer
0ad3ba6b9e wombat: cookie expires: don't remove cookie expires (to allow deleting cookies via expiration), but adjust by time difference between now and capture time 2015-08-08 02:14:40 -07:00
Ilya Kreymer
6dd432ab38 wombat: only fix window.parent on top frame if 'embeddable' is not set to true, allow for communication w/ embedding frame this way 2015-08-07 18:21:37 -07:00
Ilya Kreymer
92f3dcc2dc wombat: postMessage improvements: ensure original 'source' is also preserved
handle removeEventListener for message
2015-08-06 13:24:38 -07:00