Highlighted
Frequent Contributor.
Frequent Contributor.
1053 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
Highlighted
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.

View solution in original post

0 Likes
8 Replies
Highlighted
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;
	......
});

 

Highlighted
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
Highlighted
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.

Highlighted
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.

View solution in original post

0 Likes
Highlighted
Contributor.
Contributor.

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

Jump to solution

Hi, I am still facing the same issue as the one mentioned on closing the active tab,

I am using 12.60 Vugen along with Tru Client Script.

I have tried the approach by using a custom function and the code "pui.confirmOnClose=False" inside Evaluate Javascript function.

Still it didnt work.

0 Likes
Highlighted
Contributor.
Contributor.

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

Jump to solution
I have also tried by adding

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

but it didnt work out. Kindly help.
0 Likes
Highlighted
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 @Skboddapati,

"pui.confirmOnClose=False" only works for the specific application. If you don't use the application, it won't work for you. If you use the application, you need to modify your application code, add ""pui.confirmOnClose=False" line, not using it inside an Evaluate JavaScript step.

0 Likes
Highlighted
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 @Skboddapati,

Adding 

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

can't solve the problem.

If your application uses 

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

it may cause conflict with TruClient. Find out the places, and replace them with

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

Check if this helps.

 

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.