MCPcopy Index your code
hub / github.com/darkreader/darkreader / html

Function html

tasks/bundle-html.js:10–42  ·  view source on GitHub ↗

@typedef {import('./types.d.ts').HTMLEntry} HTMLEntry

(platform, title, hasLoader, hasStyleSheet, compatibility)

Source from the content-addressed store, hash-verified

8/** @typedef {import('./types.d.ts').HTMLEntry} HTMLEntry */
9
10function 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[]} */
45const htmlEntries = [

Callers 1

writeEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected