Referring domain name

How to find the domain name sent by htmlexe to remote server? In past have simply used “heserver” in exeout with some success, htmlexe 2024 is not being friendly with me:)

For instance, I have this on a server:

function enableCORS(req, res, next) {
  const allowedDomains = ['example.net', 'heserver', 'example.com'];
  const origin = req.headers.origin;
  const referer = req.headers.referer;

The above worked with exeout but not htmlexe.

Normally can get some info using:

console.log(document.referrer);

Any help / advice / assistance appreciated.

Are you using WebView2 or CEF?

My bad, should have stated that:)

WebView2

In WebView2, the default protocol is not https://heserver but file:///
Maybe that’s the reason why it fails. There is no domain name…
AFAIK https://heserver/ may also work in HTMLEXE but you’ll have to use some redirection in your homepage to switch to the heserver domain. file:/// is, for some reasons, faster in webview2.

Will have to figure that out, thanks.