I am creating a widget that would load in a IFrame and users will be able to place the widget on their own website. How would I get the URL of the website that is using the
A small piece of JavaScript in the iframe-d page can 'un-frame' the page:
if (top != self) {top.location.replace(self.location.href);}
Otherwise, as @mck89 says: the iframe can access the URL of the parent page using the top.location.href.
Further reading on the question How to prevent my site page to be loaded via 3rd party site frame of iframe.