MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / IsCrossZoneUrl

Method IsCrossZoneUrl

cpp/iedriver/DocumentHost.cpp:392–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392bool DocumentHost::IsCrossZoneUrl(std::string url) {
393 LOG(TRACE) << "Entering Browser::IsCrossZoneUrl";
394 std::wstring target_url = StringUtilities::ToWString(url);
395 CComPtr<IUri> parsed_url;
396 HRESULT hr = ::CreateUri(target_url.c_str(),
397 Uri_CREATE_IE_SETTINGS,
398 0,
399 &parsed_url);
400 if (FAILED(hr)) {
401 // If we can't parse the URL, assume that it's invalid, and
402 // therefore won't cross a Protected Mode boundary.
403 return false;
404 }
405 bool is_protected_mode_browser = this->IsProtectedMode();
406 bool is_protected_mode_url = is_protected_mode_browser;
407 if (url.find("about:blank") != 0) {
408 // If the URL starts with "about:blank", it won't cross the Protected
409 // Mode boundary, so skip checking if it's a Protected Mode URL.
410 is_protected_mode_url = ::IEIsProtectedModeURL(target_url.c_str()) == S_OK;
411 }
412 bool is_cross_zone = is_protected_mode_browser != is_protected_mode_url;
413 if (is_cross_zone) {
414 LOG(DEBUG) << "Navigation across Protected Mode zone detected. URL: "
415 << url
416 << ", is URL Protected Mode: "
417 << (is_protected_mode_url ? "true" : "false")
418 << ", is IE in Protected Mode: "
419 << (is_protected_mode_browser ? "true" : "false");
420 }
421 return is_cross_zone;
422}
423
424bool DocumentHost::IsProtectedMode() {
425 LOG(TRACE) << "Entering DocumentHost::IsProtectedMode";

Callers 3

OnBrowserNewWindowMethod · 0.80
ExecuteInternalMethod · 0.80
ExecuteInternalMethod · 0.80

Calls 3

IsProtectedModeMethod · 0.95
findMethod · 0.80
LOGClass · 0.50

Tested by

no test coverage detected