diff --git a/CEFInjectLib/CEFInject.cpp b/CEFInjectLib/CEFInject.cpp index edde29d..ff37a86 100644 --- a/CEFInjectLib/CEFInject.cpp +++ b/CEFInjectLib/CEFInject.cpp @@ -169,7 +169,7 @@ namespace CEFInject if (res->status == 200) { const auto json = nlohmann::json::parse(res->body); for (const auto& tab : json) { - if (tab["title"].get().starts_with(tabname)) { + if (tab["title"].get().find(tabname) != std::string::npos) { return InjectJs(tab["title"].get(), tab["webSocketDebuggerUrl"].get(), js, port); } } @@ -213,7 +213,7 @@ namespace CEFInject return [&info](const nlohmann::json::array_t& tabList) { for (const auto& tab : tabList) { - if (tab["title"].get().starts_with(info.name.data())) { + if (tab["title"].get().find(info.name.data()) != std::string::npos) { return tab; } } @@ -347,7 +347,7 @@ namespace CEFInject const auto dir_name = path.parent_path().filename(); if (path_tab_map_.contains(dir_name.wstring())) { - if (tab["title"].get().starts_with(path_tab_map_.at(dir_name.wstring()))) { + if (tab["title"].get().find(path_tab_map_.at(dir_name.wstring())) != std::string::npos) { InjectJs(tab["title"].get(), tab["webSocketDebuggerUrl"].get(), js); } }