Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions pywb/templates/head_insert.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script>
{% set urlsplit = cdx.url | urlsplit %}
wbinfo = {};
wbinfo.top_url = "{{ top_url }}";
wbinfo.top_url = {{ top_url | tojson }};
{% if is_framed %}
// Fast Top-Frame Redirect
if (window == window.top && wbinfo.top_url) {
Expand All @@ -16,16 +16,16 @@
}
}
{% endif %}
wbinfo.url = "{{ cdx.url }}";
wbinfo.timestamp = "{{ cdx.timestamp }}";
wbinfo.request_ts = "{{ wb_url.timestamp }}";
wbinfo.prefix = decodeURI("{{ wb_prefix }}");
wbinfo.mod = "{{ replay_mod }}";
wbinfo.url = {{ cdx.url | tojson }};
wbinfo.timestamp = {{ cdx.timestamp | tojson }};
wbinfo.request_ts = {{ wb_url.timestamp | tojson }};
wbinfo.prefix = decodeURI({{ wb_prefix | tojson }});
wbinfo.mod = {{ replay_mod | tojson }};
wbinfo.is_framed = {{ is_framed | tobool }};
wbinfo.is_live = {{ is_live | tobool }};
wbinfo.coll = "{{ coll }}";
wbinfo.proxy_magic = "{{ env.pywb_proxy_magic }}";
wbinfo.static_prefix = "{{ static_prefix }}/";
wbinfo.coll = {{ coll | tojson }};
wbinfo.proxy_magic = {{ env.pywb_proxy_magic | tojson }};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  File "pywb/templates/head_insert.html", line 27, in top-level template code
    wbinfo.proxy_magic = {{ env.pywb_proxy_magic | tojson }};
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pywb/rewrite/templateview.py", line 269, in tojson
    return json.dumps(obj)
           ^^^^^^^^^^^^^^^
TypeError: Undefined is not JSON serializable

wbinfo.static_prefix = {{ (static_prefix + "/") | tojson }};
wbinfo.enable_auto_fetch = {{ config.enable_auto_fetch | tobool }};
wbinfo.target_frame = "___wb_replay_top_frame";
</script>
Expand All @@ -37,10 +37,10 @@
{% if not wb_url.is_banner_only or (env.pywb_proxy_magic and (config.enable_auto_fetch or config.proxy.enable_wombat)) %}
<script src='{{ static_prefix }}/{{ whichWombat }}'> </script>
<script>
wbinfo.wombat_ts = "{{ wombat_ts }}";
wbinfo.wombat_sec = "{{ wombat_sec }}";
wbinfo.wombat_scheme = "{{ urlsplit.scheme }}";
wbinfo.wombat_host = "{{ urlsplit.netloc }}";
wbinfo.wombat_ts = {{ wombat_ts | tojson }};
wbinfo.wombat_sec = {{ wombat_sec | tojson }};
wbinfo.wombat_scheme = {{ urlsplit.scheme | tojson }};
wbinfo.wombat_host = {{ urlsplit.netloc | tojson }};

wbinfo.wombat_opts = {};

Expand Down
Loading