I am trying to get the current URL in Google HTML services , But I do not get the correct one , I use the following methods.
function pprueba(url){
console.log("Prueba : "+url);
console.log("Pruena 2 :"+window.location.href);
console.log("Pruena 3 :"+google.script.run.getScriptUrl());
console.log("Pruena 4 :"+window.location);
console.log("Pruena 5 :"+$(this).attr('href'));
}
in the server side I have this function , the first prueba are getting as parameter the result of getScriptUrl.
function getScriptUrl() {
var url = ScriptApp.getService().getUrl();
return url;
}
Prueba : https://script.google.com/macros/s/AKfycbwaCJjgSiUs6LiQq0yocXNU93DVtD30lLTEWi1NEcs/dev
Pruena 2 :https://n-4xmbqpfn3z7t4od5wj623x3uicdbwgqeelan7da-0lu-script.googleusercontent.com/userCodeAppPanel
Pruena 3 :undefined
Pruena 4 :https://n-4xmbqpfn3z7t4od5wj623x3uicdbwgqeelan7da-0lucript.googleusercontent.com/userCodeAppPanel
Pruena 5 :undefined
but what I expect is