Total Complexity | 8 |
Complexity/F | 2 |
Lines of Code | 24 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | (function() { |
||
2 | var iframe=document.getElementById("meshviewer-embedded") |
||
3 | if (!iframe) { |
||
4 | console.log("IFrame 'meshviewer-embedded' not found") |
||
|
|||
5 | return; |
||
6 | } |
||
7 | if (!iframe.contentWindow) { |
||
8 | console.log("Element 'meshviewer-embedded' seems not to be a valid iframe") |
||
9 | return; |
||
10 | } |
||
11 | if (document.location.hash) { |
||
12 | window.setTimeout(function() { |
||
13 | iframe.contentWindow.location.hash = document.location.hash; |
||
14 | }, 0); |
||
15 | } |
||
16 | iframe.contentWindow.addEventListener("message", (event) => { |
||
17 | if (event && event.data && event.data.hash) { |
||
18 | window.location.hash = event.data.hash; |
||
19 | } |
||
20 | }, false); |
||
21 | window.onhashchange = function () { |
||
22 | iframe.contentWindow.location.hash = document.location.hash; |
||
23 | }; |
||
24 | }) (); |
||
25 |