Fix simulator links if using URLs like `index.html` or `../#` (#122)

master
Gordon Williams 2020-03-09 16:45:41 +00:00
parent 22a2f75bd4
commit c1e414a0c5
1 changed files with 2 additions and 1 deletions

View File

@ -308,7 +308,8 @@ function refreshLibrary() {
return;
}
var baseurl = window.location.href;
var url = baseurl+"apps/"+app.id+"/"+file.url;
baseurl = baseurl.substr(0,baseurl.lastIndexOf("/"));
var url = baseurl+"/apps/"+app.id+"/"+file.url;
window.open(`https://espruino.com/ide/emulator.html?codeurl=${url}&upload`);
} else if (icon.classList.contains("icon-upload")) {
// upload