Skip to content

Commit

Permalink
feature: Window location hash changes on iframed content
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Oct 4, 2023
1 parent dbcf5d4 commit f3c9ee3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions resources/views/extension_pages/server_json.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ function API(target)
}
</style>

<script>
let hashData = window.location.hash;
// TODO: window.location.watch and Proxy observers not working for iframe contents
// Is there any better way to watch url changes?
setInterval(() => {
if (window.location.hash != hashData) {
hashData = window.location.hash;
const hashChangeEvent = new CustomEvent('limanHashChange', { detail: hashData });
window.dispatchEvent(hashChangeEvent, { detail: hashData });
}
}, 1500)
</script>

@include('errors')
@if(!isset($dbJson["skeleton"]) || !$dbJson["skeleton"])
<div class="card-body">
Expand Down

0 comments on commit f3c9ee3

Please sign in to comment.