From a07faa926c090968714720149699c59e9ab0ad6c Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 30 Jan 2023 12:05:11 +0100 Subject: [PATCH] CEFInject: Kill manual scoping of injection and let rollup handle that crap --- CEFInjectLib/CEFInject.cpp | 8 +------- CEFInjectLib/CEFInject.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CEFInjectLib/CEFInject.cpp b/CEFInjectLib/CEFInject.cpp index b76dfe9..297e484 100644 --- a/CEFInjectLib/CEFInject.cpp +++ b/CEFInjectLib/CEFInject.cpp @@ -66,13 +66,7 @@ namespace CEFInject return tabs; } - - nlohmann::json InjectJs(const std::wstring& tabname, const std::wstring& js, uint16_t port) - { - return InjectJs_Unscoped(tabname, L"(async function(){\n" + js + L"\n})();", port); - } - - nlohmann::json InjectJs_Unscoped(const std::wstring &tabname, const std::wstring &js, uint16_t port) + nlohmann::json InjectJs(const std::wstring &tabname, const std::wstring &js, uint16_t port) { auto cli = internal::GetHttpClient(port); if (auto res = cli.Get("/json")) { diff --git a/CEFInjectLib/CEFInject.h b/CEFInjectLib/CEFInject.h index 8c85118..fc077f6 100644 --- a/CEFInjectLib/CEFInject.h +++ b/CEFInjectLib/CEFInject.h @@ -32,6 +32,5 @@ namespace CEFInject bool CEFDebugAvailable(uint16_t port = internal::port_); std::vector AvailableTabs(uint16_t port = internal::port_); nlohmann::json InjectJs(const std::wstring& tabname, const std::wstring& js, uint16_t port = internal::port_); - nlohmann::json InjectJs_Unscoped(const std::wstring& tabname, const std::wstring& js, uint16_t port = internal::port_); } \ No newline at end of file