Cannot get GetCurrentHTMLPagePath to work

function DemoCallback(content) {
	alert("DemoCallback");
	alert(content);
} 
function clearFolders(oForm) {
	exeoutput.GetHEScriptCom('hescript://UserMain.GetHTMLPath',DemoCallback); 
}

My UserMain:

function GetHTMLPath: String;  
Begin      
   MessageBox("Start GetHTML Path","Test",MB_OK); 
   Result := GetCurrentHTMLPagePath(); 
   MessageBox(Result, "path", MB_OK); 

Result is always empty.
Anybody see why this would not work?

Avoid GetCurrentHTMLPagePath (it should be removed in the future) and use JavaScript, for instance:

const currentUrl = window.location.href;