Injecting the base tag via a script causes assets to be requested once from an invalid url and then again from the correct one after the base tag got injected. Setting it statically won't cause any problems with the servers subpath injection, because the browser will just use the first base tag in case there are multiple. fixes #1096
65 lines
2.8 KiB
HTML
65 lines
2.8 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<base href="/" />
|
|
<title>Suwayomi</title>
|
|
<meta name="apple-mobile-web-app-title" content="Suwayomi" />
|
|
<meta name="description" content="A manga reader that runs tachiyomi's extensions" />
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta name="viewport" content="minimum-scale=1, initial-scale=1, viewport-fit=cover, width=device-width" />
|
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
|
|
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
<link rel="shortcut icon" href="/favicon.ico" />
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
<!--
|
|
manifest.json provides metadata used when your web app is installed on a
|
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
-->
|
|
<link rel="manifest" href="/site.webmanifest" crossorigin="use-credentials" />
|
|
</head>
|
|
<body>
|
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
<div id="root"></div>
|
|
<script type="module" src="./src/index.tsx"></script>
|
|
<script>
|
|
const backgroundColor = (() => {
|
|
const storageValue = window.localStorage.getItem('theme_background');
|
|
try {
|
|
return JSON.parse(storageValue);
|
|
} catch (e) {
|
|
return storageValue;
|
|
}
|
|
})();
|
|
|
|
if (backgroundColor) {
|
|
document.documentElement.style.backgroundColor = backgroundColor;
|
|
// android chromium-based browser/pwa background color (e.g. top status bar and navigation bar) will change dynamically based on meta theme-color
|
|
let themeColorMeta = document.querySelector('meta[name="theme-color"]');
|
|
if (!themeColorMeta) {
|
|
themeColorMeta = document.createElement('meta');
|
|
themeColorMeta.setAttribute('name', 'theme-color');
|
|
document.head.appendChild(themeColorMeta);
|
|
}
|
|
if (themeColorMeta.getAttribute('content') !== backgroundColor) {
|
|
themeColorMeta.setAttribute('content', backgroundColor);
|
|
}
|
|
}
|
|
</script>
|
|
<!--
|
|
This HTML file is a template.
|
|
If you open it directly in the browser, you will see an empty page.
|
|
|
|
You can add webfonts, meta tags, or analytics to this file.
|
|
The build step will place the bundled scripts into the <body> tag.
|
|
|
|
To begin the development, run `npm start` or `yarn start`.
|
|
To create a production bundle, use `npm run build` or `yarn build`.
|
|
-->
|
|
</body>
|
|
</html>
|