How to get the website url via JS

I have a Vaadin form application that is used for several updates. I included this form as part of a wesbite using iframe.

I want to retrieve the website url(which is different for each logged in user) inorder to capture unique id for the update operation. This website is built in React JS.

I tried .javaScript.execute() methods, doesnt seem to return anything.

Is this anyway to get the website url via Javascript ?

Thank you.

You could try this one: https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer

If you’re just after the URI fragment, you can get that from getPage().getUriFragment();