Skip to content

Commit

Permalink
Fixing IE change in behavior recognizing closing of showModalDialog w…
Browse files Browse the repository at this point in the history
…indows

Fixes issue #6574.
  • Loading branch information
jimevans committed Oct 25, 2018
1 parent 935411f commit 150b032
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
18 changes: 17 additions & 1 deletion cpp/iedriver/HtmlDialog.cpp
Expand Up @@ -22,6 +22,8 @@
#include "BrowserFactory.h"
#include "StringUtilities.h"

#define HIDDEN_PARENT_WINDOW_CLASS "Internet Explorer_Hidden"

namespace webdriver {

HtmlDialog::HtmlDialog(IHTMLWindow2* window, HWND hwnd, HWND session_handle) : DocumentHost(hwnd, session_handle) {
Expand Down Expand Up @@ -186,7 +188,21 @@ std::string HtmlDialog::GetTitle() {

HWND HtmlDialog::GetTopLevelWindowHandle(void) {
LOG(TRACE) << "Entering HtmlDialog::GetTopLevelWindowHandle";
return ::GetParent(this->window_handle());
HWND parent_handle = ::GetParent(this->window_handle());

// "Internet Explorer_Hidden\0" == 25
std::vector<char> parent_class_buffer(25);
if (::GetClassNameA(parent_handle, &parent_class_buffer[0], 25)) {
if (strcmp(HIDDEN_PARENT_WINDOW_CLASS, &parent_class_buffer[0]) == 0) {
// Some versions of Internet Explorer re-parent a closing showModalDialog
// window to a hidden parent window. If that is what we see happening
// here, that will be equivalent to the parent window no longer being
// valid, and we can return an invalid handle, indicating the window is
// "closed."
return NULL;
}
}
return parent_handle;
}

HWND HtmlDialog::GetActiveDialogWindowHandle() {
Expand Down
8 changes: 4 additions & 4 deletions cpp/iedriver/IEDriver.rc
Expand Up @@ -50,8 +50,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,14,0,14
PRODUCTVERSION 3,14,0,14
FILEVERSION 3,14,0,15
PRODUCTVERSION 3,14,0,15
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Software Freedom Conservancy"
VALUE "FileDescription", "Driver library for the IE driver"
VALUE "FileVersion", "3.14.0.14"
VALUE "FileVersion", "3.14.0.15"
VALUE "InternalName", "IEDriver.dll"
VALUE "LegalCopyright", "Copyright (C) 2018"
VALUE "OriginalFilename", "IEDriver.dll"
VALUE "ProductName", "Selenium WebDriver"
VALUE "ProductVersion", "3.14.0.14"
VALUE "ProductVersion", "3.14.0.15"
END
END
BLOCK "VarFileInfo"
Expand Down
5 changes: 5 additions & 0 deletions cpp/iedriverserver/CHANGELOG
Expand Up @@ -9,6 +9,11 @@ available via the project downloads page. Changes in "revision" field indicate
private releases checked into the prebuilts directory of the source tree, but
not made generally available on the downloads page.

v3.14.0.15
==========
* Fixed change in behavior recognizing closing of showModalDialog windows.
Fixes issue #6574.

v3.14.0.14
==========
* Fixed retrieval of CSS properties that return non-string values. Fixes
Expand Down
8 changes: 4 additions & 4 deletions cpp/iedriverserver/IEDriverServer.rc
Expand Up @@ -50,8 +50,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,14,0,14
PRODUCTVERSION 3,14,0,14
FILEVERSION 3,14,0,15
PRODUCTVERSION 3,14,0,15
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Software Freedom Conservancy"
VALUE "FileDescription", "Command line server for the IE driver"
VALUE "FileVersion", "3.14.0.14"
VALUE "FileVersion", "3.14.0.15"
VALUE "InternalName", "IEDriverServer.exe"
VALUE "LegalCopyright", "Copyright (C) 2018"
VALUE "OriginalFilename", "IEDriverServer.exe"
VALUE "ProductName", "Selenium WebDriver"
VALUE "ProductVersion", "3.14.0.14"
VALUE "ProductVersion", "3.14.0.15"
END
END
BLOCK "VarFileInfo"
Expand Down
Binary file modified cpp/prebuilt/Win32/Release/IEDriverServer.exe
Binary file not shown.
Binary file modified cpp/prebuilt/x64/Release/IEDriverServer.exe
Binary file not shown.

0 comments on commit 150b032

Please sign in to comment.