Highlighted
Vignesh Kumar Frequent Contributor.
Frequent Contributor.
602 views

Truclient 12.55 not handling the confirmation popup while closing the active tab in Chromium browser

Jump to solution

Hi All,

I would like to close the active tab in Chromium browser in order to log-out successfully from my application where there is an error in middle of a work flow. The browser gives a confirmation pop-up whether to leave the site or not when we try to close the active tab (when the application is logged in). I would like to record the "Leave" button click in that pop-up and place it as one of the event handler but Truclient protocol was not recognizing that pop-up at all. Could someone suggest me some steps to handle that pop-up or is there a way to close the active tab with a piece of code which I can place it in the 'Evaluate Javascript or C' step.

I didn't have this problem with Truclient Firefox browser as it is using a outdated firefox version where this confirmation pop-up won't occur while closing the active tabs. Due to some issues with our application, we need to move our Truclient scripts to use Chromium browser and I am stuck with pop-up issue right now

Regards,

Vignesh

 

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Vignesh Kumar Frequent Contributor.
Frequent Contributor.

Re: Truclient 12.55 not handling the confirmation popup while closing the active tab in Chromium bro

Jump to solution

Thank you All for the Support.

The issue got resolved after placing "pui.confirmOnClose = false;" under pui.onload function inside the respective custom.js file in my apache instances.

0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Truclient 12.55 not handling the confirmation popup while closing the active tab in Chromium bro

Jump to solution

Hi,

This dialog is popped-up by Chromium once the page assigns an event handle of "beforeunload" event.

It's probably because in this page, an event handler of "beforeunload" event is assigned in below way, after page is loaded.

window.onbeforeunload = function (e) {
...... e.returnValue = something;
...... };

With new JavaScript standards and new browser APIs, below way is the suggested way to handle "beforeunload" event. TruClient can fully support this way.

 

window.addEventListener("beforeunload", function (e) {
	......
	e.returnValue = something;
	......
});

 

Vignesh Kumar Frequent Contributor.
Frequent Contributor.

Re: Truclient 12.55 not handling the confirmation popup while closing the active tab in Chromium bro

Jump to solution

Thanks Alex for the response.

So you want us to update the below code in our application and see if Truclient script doesn't throw that pop-up again?

 

window.addEventListener("beforeunload", function (e) {return null;});

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Truclient 12.55 not handling the confirmation popup while closing the active tab in Chromium bro

Jump to solution

Please check in your application which way is used to handle beforeunload event. If below way is used,

window.onbeforeunload = function (e) { e.returnValue = something; };

try to use below way in your application.

 

window.addEventListener("beforeunload", function (e) { e.returnValue = something; });

Notice use e.returnValue to return something (Chrome 34+), not return something directly (as you wrote: return null;).

If window.addEventListener way is already used by your application, this could be another problem. If so, I'd suggest you to submit a ticket.

Vignesh Kumar Frequent Contributor.
Frequent Contributor.

Re: Truclient 12.55 not handling the confirmation popup while closing the active tab in Chromium bro

Jump to solution

Thank you All for the Support.

The issue got resolved after placing "pui.confirmOnClose = false;" under pui.onload function inside the respective custom.js file in my apache instances.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.