From 007860f8f771a7ee62b1c384fbe4f741528a75d5 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Mon, 30 May 2022 14:26:54 -0400 Subject: react: Add Router hook & fix typescript issues (#68) * add rollup watch command, add pnpm lockfile * wait for react * add WIP patcher, window hook, and webpack * fix typescript, fix React, lint, add pnpm to gitignore * actually fix react * show frontend JS errors in console * cleanup * Add Router hook * Remove console.log * Expose routerHook in createPluginAPI Co-authored-by: Jonas Dellinger --- backend/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/main.py') diff --git a/backend/main.py b/backend/main.py index 0bf0a49d..f942ee29 100644 --- a/backend/main.py +++ b/backend/main.py @@ -86,7 +86,7 @@ class PluginManager: async def inject_javascript(self, request=None): try: - await inject_to_tab("SP", open(path.join(path.dirname(__file__), "./static/plugin-loader.iife.js"), "r").read(), True) + await inject_to_tab("SP", "try{" + open(path.join(path.dirname(__file__), "./static/plugin-loader.iife.js"), "r").read() + "}catch(e){console.error(e)}", True) except: logger.info("Failed to inject JavaScript into tab") pass -- cgit v1.2.3