You may be able to use a ParentWindow query (referenced here) for this. I don't know of a way to query the parent document object directly but if you store the page's URL in a DOM element you should be able to access it.
Say you have something like
<div id="page_url" hidden></div>
on your webpage and then set its value to be the page's URL in the same script where you embed Retool using something like