diff --git a/src/pyj/book_list/main.pyj b/src/pyj/book_list/main.pyj index 9e83e5653f..aa303ebac8 100644 --- a/src/pyj/book_list/main.pyj +++ b/src/pyj/book_list/main.pyj @@ -125,6 +125,12 @@ def do_update_interface_data(): def main(): + if document.createElement('iframe').srcdoc is undefined: + document.body.innerHTML = '
' + _( + 'You are using a browser that does not have the iframe srcdoc attribute.' + ' This is not supported. Use a better browser such as Google Chrome or Mozilla' + ' Firefox, instead.') + return interface_data = get_interface_data() if interface_data.is_default or not interface_data.library_map: load_interface_data() diff --git a/src/pyj/utils.pyj b/src/pyj/utils.pyj index 1f6ddf1ab3..dad3172d6d 100644 --- a/src/pyj/utils.pyj +++ b/src/pyj/utils.pyj @@ -231,7 +231,9 @@ def sandboxed_html(html, style, sandbox): html = html or '' css = 'html, body { margin: 0; padding: 0; font-family: __FONT__ } p:first-child { margin-top: 0; padding-top: 0; -webkit-margin-before: 0 }'.replace('__FONT__', get_font_family()) css += style or '' - ans.srcdoc = f'
{html}' + final_html = f'{html}' + # Microsoft Edge does not support srcdoc not does it work using a data URI. + ans.srcdoc = final_html return ans if __name__ is '__main__':