Skip to content

Commit

Permalink
html5 mode simulation for github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mseemann committed Jun 13, 2016
1 parent fa1a561 commit abcbd3f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/e2e-app/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<script>
sessionStorage.redirect = location.href;
</script>
<meta http-equiv="refresh" content="0;URL='http://www.mseemann.de/angular2-mdl/'"></meta>
</head>
<body>

Please navigate to <a href="http://www.mseemann.de/angular2-mdl/">http://www.mseemann.de/angular2-mdl/</a>.

</body>
</html>
8 changes: 8 additions & 0 deletions src/e2e-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
<script>
System.import('system-config.js').then(function () {
System.import('main');

// simulate html5 mode server behavior on github pages - see 404.html
var redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
if (redirect && redirect != location.href) {
history.replaceState(null, null, redirect);
}

}).catch(console.error.bind(console));
</script>

Expand Down

0 comments on commit abcbd3f

Please sign in to comment.