()
| 97 | }); |
| 98 | |
| 99 | async function runPage() { |
| 100 | const pageObjects = await Chibi().catch(e => { |
| 101 | if (e instanceof NotFoundError) { |
| 102 | return pages; |
| 103 | } |
| 104 | throw e; |
| 105 | }); |
| 106 | |
| 107 | try { |
| 108 | if (inIframe()) throw 'iframe'; |
| 109 | page = new SyncPage(window.location.href, pageObjects, floatClick); |
| 110 | } catch (e) { |
| 111 | con.info(e); |
| 112 | iframe(); |
| 113 | return; |
| 114 | } |
| 115 | page.init(); |
| 116 | api.storage.set('iframePlayer', 'null'); |
| 117 | setInterval(async function () { |
| 118 | const item = await api.storage.get('iframePlayer'); |
| 119 | if (typeof item !== 'undefined' && item !== 'null') { |
| 120 | PlayerSingleton.getInstance().setIframeProgress(item); |
| 121 | api.storage.set('iframePlayer', 'null'); |
| 122 | } |
| 123 | }, 2000); |
| 124 | } |
| 125 | |
| 126 | function iframe() { |
| 127 | const player = PlayerSingleton.getInstance().startTracking(); |
no test coverage detected