|
|
@ -68,6 +68,11 @@ namespace CEFInject
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nlohmann::json InjectJs(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)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return InjectJs_Unscoped(tabname, L"(function(){\n" + js + L"\n})()", port);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nlohmann::json InjectJs_Unscoped(const std::wstring &tabname, const std::wstring &js, uint16_t port)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto cli = internal::GetHttpClient(port);
|
|
|
|
auto cli = internal::GetHttpClient(port);
|
|
|
|
if (auto res = cli.Get("/json")) {
|
|
|
|
if (auto res = cli.Get("/json")) {
|
|
|
@ -128,5 +133,4 @@ namespace CEFInject
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|