2
0
mirror of https://github.com/Alia5/GlosSI.git synced 2024-10-30 15:20:38 +00:00

CEFInject: Kill manual scoping of injection and let rollup handle that crap

This commit is contained in:
Peter Repukat 2023-01-30 12:05:11 +01:00
parent d60def51d5
commit a07faa926c
2 changed files with 1 additions and 8 deletions

View File

@ -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")) {

View File

@ -32,6 +32,5 @@ namespace CEFInject
bool CEFDebugAvailable(uint16_t port = internal::port_);
std::vector<std::wstring> 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_);
}