MCPcopy
hub / github.com/MALSync/MALSync / runPage

Function runPage

src/index.ts:99–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97});
98
99async 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
126function iframe() {
127 const player = PlayerSingleton.getInstance().startTracking();

Callers 1

mainFunction · 0.85

Calls 9

ChibiFunction · 0.90
inIframeFunction · 0.85
iframeFunction · 0.85
setIframeProgressMethod · 0.80
setMethod · 0.65
getMethod · 0.65
infoMethod · 0.45
initMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected