MCPcopy Create free account
hub / github.com/MALSync/MALSync / init

Function init

src/pages/Proxer/main.ts:108–141  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

106 },
107 },
108 init(page) {
109 api.storage.addStyle(
110 require('!to-string-loader!css-loader!less-loader!./style.less').toString(),
111 );
112 if (j.$('.g-recaptcha').length) {
113 con.log('loading');
114 page.cdn('captcha');
115 return;
116 }
117 if (page.url.split('/')[3] === 'watch' || page.url.split('/')[3] === 'read') {
118 if (page.url.split('/')[3] === 'watch') {
119 Proxer.type = 'anime';
120 } else if (page.url.split('/')[3] === 'read') {
121 Proxer.type = 'manga';
122 }
123 j.$(document).ready(function () {
124 if (
125 j.$(
126 'h3:contains(Bitte logge dich ein!), img[alt*="Diese Seite wurde nicht gefunden oder wurde verschoben"]',
127 ).length
128 ) {
129 con.error('404');
130 return;
131 }
132 page.handlePage();
133 });
134 }
135
136 ajaxHandle(page);
137 utils.urlChangeDetect(function () {
138 page.reset();
139 ajaxHandle(page);
140 });
141 },
142};
143
144let current = 0;

Callers

nothing calls this directly

Calls 6

ajaxHandleFunction · 0.85
addStyleMethod · 0.80
cdnMethod · 0.80
errorMethod · 0.80
handlePageMethod · 0.80
resetMethod · 0.80

Tested by

no test coverage detected