Disable base href for electron

This commit is contained in:
ziajka
2018-07-20 09:01:37 +02:00
parent 5b335f25e9
commit fd606194b8
2 changed files with 13 additions and 12 deletions

View File

@ -15,7 +15,7 @@ init:
install: install:
- ps: Install-Product node 8 x64 - ps: Install-Product node 8 x64
- yarn - yarn install
build_script: build_script:
- yarn buildforelectron - yarn buildforelectron

View File

@ -2,22 +2,23 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>GNS3 Web UI Demo</title> <title>GNS3 Web UI</title>
<!-- It's important to have base here because of the script below //--> <!-- It's important to have base here because of the script below //-->
<base href="/"> <base href="./">
<script> <script>
var userAgent = navigator.userAgent.toLowerCase(); var userAgent = navigator.userAgent.toLowerCase();
// in case we're running in electron because we need it for resources // in case we're running in electron because we need it for resources
if (userAgent.indexOf(' electron/') > -1) { // if (userAgent.indexOf(' electron/') > -1) {
var base = document.getElementsByTagName('base'); // var base = document.getElementsByTagName('base');
if(base.length > 0) { // if(base.length > 0) {
base.href = document.location; // base.href = document.location;
} // }
else { // else {
document.write('<base href="' + document.location + '" />'); // document.write('<base href="' + document.location + '" />');
} // }
} // }
</script> </script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">