From 4e92d4bfc5652304a6ec0b62e70ab0574ffe159d Mon Sep 17 00:00:00 2001 From: Sky Leite Date: Sat, 4 Feb 2023 00:29:34 -0300 Subject: Fix unescaped curly braces in javascript formatting This would previously throw an error due to `format` interpreting the curly braces as placeholders --- backend/injector.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'backend/injector.py') diff --git a/backend/injector.py b/backend/injector.py index f62ddc48..131dbc4a 100644 --- a/backend/injector.py +++ b/backend/injector.py @@ -261,18 +261,19 @@ class Tab: wrappedjs = ( """ - function scriptFunc() { + function scriptFunc() {{ {js} - } - if (document.readyState === 'loading') { - addEventListener('DOMContentLoaded', () => { + }} + if (document.readyState === 'loading') {{ + addEventListener('DOMContentLoaded', () => {{ scriptFunc(); - }); - } else { + }}); + }} else {{ scriptFunc(); - } + }} """.format( - ) + js=js + ) if add_dom_wrapper else js ) -- cgit v1.2.3