bool LootHandler::OnBeforeBrowse(CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, bool is_redirect) { BOOST_LOG_TRIVIAL(trace) << "Attempting to open link: " << request->GetURL().ToString(); if (boost::starts_with(request->GetURL().ToString(), "http://loot/")) { BOOST_LOG_TRIVIAL(trace) << "Link is to LOOT page, allowing CEF's default handling."; return false; } BOOST_LOG_TRIVIAL(info) << "Opening link in Windows' default handler."; OpenInDefaultApplication(boost::filesystem::path(request->GetURL().ToString())); return true; }
bool LootHandler::OnBeforeBrowse(CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, bool is_redirect) { BOOST_LOG_TRIVIAL(trace) << "Attempting to open link: " << request->GetURL().ToString(); BOOST_LOG_TRIVIAL(trace) << "Comparing with URL: " << ToFileURL(g_path_report); if (boost::iequals(request->GetURL().ToString(), ToFileURL(g_path_report))) { BOOST_LOG_TRIVIAL(trace) << "Link is to LOOT page, allowing CEF's default handling."; return false; } BOOST_LOG_TRIVIAL(info) << "Opening link in Windows' default handler."; OpenInDefaultApplication(fs::path(request->GetURL().ToString())); return true; }