@typedef {import('./types.d.ts').HTMLEntry} HTMLEntry
(platform, title, hasLoader, hasStyleSheet, compatibility)
| 8 | /** @typedef {import('./types.d.ts').HTMLEntry} HTMLEntry */ |
| 9 | |
| 10 | function html(platform, title, hasLoader, hasStyleSheet, compatibility) { |
| 11 | return [ |
| 12 | '<!DOCTYPE html>', |
| 13 | '<html>', |
| 14 | ' <head>', |
| 15 | ' <meta charset="utf-8" />', |
| 16 | ` <title>${title}</title>`, |
| 17 | hasStyleSheet ? [ |
| 18 | ' <meta name="theme-color" content="#0B2228" />', |
| 19 | ' <meta name="viewport" content="width=device-width, initial-scale=1" />', |
| 20 | ' <link rel="stylesheet" type="text/css" href="style.css" />', |
| 21 | ' <link', |
| 22 | ' rel="shortcut icon"', |
| 23 | ' href="../assets/images/darkreader-icon-256x256.png"', |
| 24 | ' />', |
| 25 | ] : null, |
| 26 | ' <script src="index.js" defer></script>', |
| 27 | (compatibility && platform === PLATFORM.CHROMIUM_MV2) ? ' <script src="compatibility.js" defer></script>' : null, |
| 28 | ' </head>', |
| 29 | '', |
| 30 | hasLoader ? [ |
| 31 | ' <body>', |
| 32 | ' <div class="loader">', |
| 33 | ' <label class="loader__message">Loading, please wait</label>', |
| 34 | ' </div>', |
| 35 | ' </body>', |
| 36 | ] : [ |
| 37 | ' <body></body>', |
| 38 | ], |
| 39 | '</html>', |
| 40 | '', |
| 41 | ].filter((s) => s !== null).flat().join('\r\n'); |
| 42 | } |
| 43 | |
| 44 | /** @type {HTMLEntry[]} */ |
| 45 | const htmlEntries = [ |