Skip to content

Commit

Permalink
Update frames.erb
Browse files Browse the repository at this point in the history
  • Loading branch information
RedYetiDev authored Feb 29, 2024
1 parent 7cb3fc5 commit c88406e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions templates/default/fulldoc/html/frames.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
<title><%= options.title %></title>
</head>
<script type="text/javascript">
var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
var name = match ? match[1] : '<%= url_for_main %>';
name = name.replace(/^((\w*):)?[\/\\]*/gm, '').trim();
window.top.location.replace(name)
try {
var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
var name = match ? match[1] : '<%= url_for_main %>';
var url = new URL(name, location.href);
window.top.location.replace(url.origin === location.origin ? name : '<%= url_for_main %>');
} catch (e) {
window.top.location.replace('<%= url_for_main %>');
}
</script>
<noscript>
<h1>Oops!</h1>
Expand Down

0 comments on commit c88406e

Please sign in to comment.