1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 08:04:49 +01:00

vidrw: ensure iframe replacement does get rewritten!

regex rewrite: include '==top?' for wombat rewrite
rewrite css: if js_ modifier on text/css, treat as css
This commit is contained in:
Ilya Kreymer 2015-07-18 12:59:20 -07:00
parent a7e1d310dc
commit 9b08ca9005
3 changed files with 5 additions and 2 deletions

View File

@ -139,7 +139,7 @@ class JSLocationRewriterMixin(object):
# (r'(?<=document\.)cookie', RegexRewriter.add_prefix(prefix), 0),
#todo: move to mixin?
(r'(?<=[\s=(){])(top)\s*(?:[!})]|==|$)',
(r'(?<=[\s=(){])(top)\s*(?:[!}?)]|==|$)',
RegexRewriter.add_prefix(prefix), 1),
(r'^(top)\s*(?:[!})]|==|$)',

View File

@ -218,6 +218,9 @@ class RewriteContent:
@staticmethod
def _resolve_text_type(mod, text_type, stream):
if text_type == 'css' and mod == 'js':
return 'css', stream
# only attempt to resolve between html and other text types
if text_type != 'html':
return mod, stream

View File

@ -352,7 +352,7 @@ __wbvidrw = (function() {
}
function do_replace_iframe(elem, url) {
var iframe = document.createElement("iframe", true);
var iframe = document.createElement("iframe");
var dim = get_dim(elem);
iframe.width = dim[0];
iframe.height = dim[1];