Support Article
Pop up doesn't come to focus when called a second time in Chrome
SA-2333
Summary
When a section has been configured to display a harness in a new window using openURLInWindow(), the focus is brought to the window whenever the section is accessed in Internet Explorer (IE).
In Chrome, when the section is accessed a second time, the window gets refreshed in the background and it is not brought to focus.
Error Messages
Not Applicable.
Steps to Reproduce
1. Create an activity to display a harness.
2. Create a control to open the harness mentioned in the activity in a new window using openUrlInWindow ().
3. Create a new case. The harness gets opened in a new window and the focus is set to it. Traverse to a child case and then go back to the parent case. The focus does not get set to the opened window (harness window). However, in IE, every time the parent case is accessed, the focus is set to the opened window.
Root Cause
This behavior is due to a limitation with Chrome browser.
Resolution
In this case, an existing window needs to be closed before opening a new one. This is indirectly same as opening a fresh window.
Opening a blank page and closing it before opening the required window will resolve this issue.
The custom control used to open the harness in a window has to be modified as below:
<script type="text/javascript">
var oSafeUrl_signature = SafeURL_createFromEncryptedURL("?pyActivity=Test-TestCase.OpenPage&pzPrimaryPageName=pyWorkPage");
//LOCAL-CHANGE FOR THIS ISSUE – START
var openWindow = openUrlInWindow(“_blank”, "Verify Sig", "height=550,width=900,resizable=yes,scrollbars=yes", "false");
openWindow.close();
//LOCAL-CHANGE FOR THIS ISSUE – END
openUrlInWindow(oSafeUrl_signature, "Verify Sig", "height=550,width=900,resizable=yes,scrollbars=yes", "false");
</script>
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.