MS Edge session - Custom Login Script

Resolved

MS Edge session - Custom Login Script

0 vote

avatar

We have moved to newly improved web session engine "Microsoft Edge". We like that it uses the embedded browser in OS - so it is always up-to-date (more secure) has all the functionality (more than the portable Chrome engine). Besides it solves our problem with freezing RDM while using it on terminal server with open web sessions.

However, we are missing the functionality of providing custom javascript login scripts (Login - Custom - Custom Script). We are using them for login form autofill of some specific webpages, which cannot be filled just by simply providing input fields IDs.

So we would like to ask for this feature :). To be able use custom javascript login scripts with MS Edge engine ((Login - Custom - Custom Script)) as it can be used with Chrome engine.

Martin

All Comments (7)

avatar

Hi Martin,

Thank you for the request. I will add this to your internal ticketing system.

As for the Custom Script, do you have a sample script and (public) website that you can share that works with Chrome so that we can test to make sure it works with properly on Edge?

I am no JavaScript expert and having a script would be very useful. Make sure no private data is contained within the script. You can either post it here and send me the script via direct message if you like.

Best regards,

Stéfane Lavergne

avatar

Hi Stéfane,

so today I had little bit more time to look into it. So here is a funny fact 😁. The Custom Scripts are working, but in GUI, we are not able to configure them, as the option disappear when you change the browser engine to Microsoft Edge (I have to switch it to Chrome, enter the custom script and then switch it back to Edge). So I guess the feature request shouldn't be hard to implement (just to allow it in GUI)

Here are some examples of custom Javascript for login:

1) Some login forms don't have static ID/names for the input fields - the RDM is not able to detect them and fill them. So we have to use dynamic selectors.
ex: Fortinet EMS (https://fctems.fortidemo.com/signin)

var elements = document.getElementsByTagName("input");
elements[1].setAttribute("value", "$USERNAME$");
elements[1].dispatchEvent(new Event("input", { bubbles: true }));
elements[2].setAttribute("value", "$PASSWORD$");
elements[2].dispatchEvent(new Event("input", { bubbles: true }));
btn = document.getElementsByClassName("btn-primary");
btn[0].click();


2) Some login pages have the login button disabled until you type something into the username/password field. The way the RDM fills those values probably differs from the manual input (I guest not all the events are trigered). So we use Javascript to unblock the login button:

var button = document.getElementById("buttonLogin");
button.disabled = false;
button.classList.remove("btn-disabled");


avatar

Little correction. I am unable to put the custom login JavaScript through GUI the way I have described. It gets blank.

But I am able to do it through PowerShell (this was the way we migrated from Chrome to Edge).

So I am able to:

  • create new session as Chrome.
  • Insert the custom javascript login script.
  • Save it
  • Open powershell, find the session and just change the engine from Chrome to Edge.
  • Then if I try to open the session in RDM it gets opened in Edge and the Javascript gets fired.


So still it looks like the functionality is there and working. We just need to modify the GUI to support the custom login scripts for Edge engine :).

avatar

Perfect, yes you are correct we will only need to adjust the GUI and the save code to allow the saving of the script.

Amazing find on the work around at the same time you've saved me a lot of time and effort.

Stéfane Lavergne

avatar

Happy to help. Thank you Stéfane 👍🏼

avatar

Hello,

We've implemented your request, the custom script feature should be available when using Edge. This should be available as early as next version. Let us know if there are any other issues!

Regards,

Jafran Majeau

avatar

Thank you Jafran, that was quick 👍🏼.