From 8029bef98be86afffc0f29bd4bff98eca3bd8b14 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Apr 2019 09:45:48 +0530 Subject: [PATCH] Content server: Fix links to external resources in book details and the viewer not working --- src/pyj/book_list/book_details.pyj | 2 +- src/pyj/read_book/view.pyj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index 25b5b48078..0cdd77fc09 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -132,7 +132,7 @@ def adjusting_sandboxed_html(html): css = 'html, body {{ overflow: hidden; color: {} }}'.format(get_color('window-foreground')) # allow-same-origin is needed for resizing and allow-popups is needed for # target="_blank" - ans = sandboxed_html(html, css, 'allow-same-origin allow-popups') + ans = sandboxed_html(html, css, 'allow-same-origin allow-popups allow-popups-to-escape-sandbox') ans.addEventListener('load', def(ev): setup_iframe(ev.target);) ans.style.height = '50vh' ans.dataset.last_window_width = '0' diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index 3cded9fdcf..a24e01a618 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -135,7 +135,7 @@ class View: left_margin, E.div(style='flex-grow:2; display:flex; align-items:stretch; flex-direction: column', # container for top and bottom margins margin_elem(sd, 'margin_top', 'book-top-margin', self.top_margin_clicked), - E.iframe(id=iframe_id, seamless=True, sandbox='allow-popups allow-scripts', style='flex-grow: 2', allowfullscreen='true'), + E.iframe(id=iframe_id, seamless=True, sandbox='allow-popups allow-scripts allow-popups-to-escape-sandbox', style='flex-grow: 2', allowfullscreen='true'), margin_elem(sd, 'margin_bottom', 'book-bottom-margin'), ), right_margin,