MCPcopy Index your code
hub / github.com/MALSync/MALSync / main

Function main

src/index.ts:23–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21let page;
22
23async function main() {
24 if (utils.isDomainMatching(window.location.href, 'myanimelist.net')) {
25 injectDb();
26 const mal = new MyAnimeListClass(window.location.href);
27 mal.init();
28 if (window.location.href.indexOf('episode') > -1) {
29 await runPage();
30 }
31 } else if (utils.isDomainMatching(window.location.href, 'anilist.co')) {
32 /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
33 const anilist = new AnilistClass(window.location.href);
34 } else if (utils.isDomainMatching(window.location.href, 'kitsu.app')) {
35 /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
36 const kitsu = new KitsuClass(window.location.href);
37 } else if (utils.isDomainMatching(window.location.href, 'mangabaka.org')) {
38 /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
39 const mangabaka = new MangaBakaClass();
40 } else if (utils.isDomainMatching(window.location.href, 'simkl.com')) {
41 /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
42 const simkl = new SimklClass(window.location.href);
43 } else if (
44 window.location.hostname === 'malsync.moe' &&
45 window.location.pathname.startsWith('/mal/oauth')
46 ) {
47 oauth();
48 } else if (
49 window.location.hostname === 'malsync.moe' &&
50 window.location.pathname.startsWith('/anilist/oauth')
51 ) {
52 anilistOauth();
53 } else if (
54 window.location.hostname === 'malsync.moe' &&
55 window.location.pathname.startsWith('/mangabaka/oauth')
56 ) {
57 mangabakaOauth();
58 } else if (
59 window.location.hostname === 'malsync.moe' &&
60 window.location.pathname.startsWith('/shikimori/oauth')
61 ) {
62 shikiOauth();
63 } else if (
64 window.location.hostname === 'malsync.moe' &&
65 window.location.pathname.startsWith('/pwa')
66 ) {
67 injectDb();
68 pwa();
69 } else {
70 await runPage();
71 }
72 firebaseNotification();
73
74 shortcutListener(shortcut => {
75 con.log('[content] Shortcut', shortcut);
76 switch (shortcut.shortcut) {
77 case 'correctionShort':
78 page.openCorrectionUi();
79 break;
80 case 'syncShort':

Callers 1

index.tsFile · 0.70

Calls 12

initMethod · 0.95
oauthFunction · 0.90
anilistOauthFunction · 0.90
mangabakaOauthFunction · 0.90
shikiOauthFunction · 0.90
pwaFunction · 0.90
firebaseNotificationFunction · 0.90
shortcutListenerFunction · 0.90
injectDbFunction · 0.85
runPageFunction · 0.85
openCorrectionUiMethod · 0.80

Tested by

no test coverage detected