forked from newthuhole/hole_thu_frontend
CDN test
This commit is contained in:
@@ -18,10 +18,10 @@
|
|||||||
<link rel="apple-touch-icon" sizes="512x512" href="%PUBLIC_URL%/static/favicon/512.png" />
|
<link rel="apple-touch-icon" sizes="512x512" href="%PUBLIC_URL%/static/favicon/512.png" />
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||||
<meta name="apple-mobile-web-app-title" content="树洞">
|
<meta name="apple-mobile-web-app-title" content="树洞">
|
||||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/splash/750x1334.png" media="(device-width: 375px) and (-webkit-device-pixel-ratio: 2)"/>
|
<link rel="apple-touch-startup-image" href="%PUBLIC_URL%/static/splash/750x1334.png" media="(device-width: 375px) and (-webkit-device-pixel-ratio: 2)"/>
|
||||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/splash/1242x2208.png" media="(device-width: 414px) and (-webkit-device-pixel-ratio: 3)"/>
|
<link rel="apple-touch-startup-image" href="%PUBLIC_URL%/splash/1242x2208.png" media="(device-width: 414px) and (-webkit-device-pixel-ratio: 3)"/>
|
||||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/splash/1668x2388.png" media="(device-width: 834px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"/>
|
<link rel="apple-touch-startup-image" href="%PUBLIC_URL%/splash/1668x2388.png" media="(device-width: 834px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"/>
|
||||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/splash/2388x1668.png" media="(device-width: 834px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"/>
|
<link rel="apple-touch-startup-image" href="%PUBLIC_URL%/static/splash/2388x1668.png" media="(device-width: 834px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"/>
|
||||||
|
|
||||||
<title>T大树洞</title>
|
<title>T大树洞</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ const isLocalhost = Boolean(
|
|||||||
export default function register() {
|
export default function register() {
|
||||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||||
// The URL constructor is available in all browsers that support SW.
|
// The URL constructor is available in all browsers that support SW.
|
||||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
// const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||||
if (publicUrl.origin !== window.location.origin) {
|
// if (publicUrl.origin !== window.location.origin) {
|
||||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
// // Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
// from what our page is served on. This might happen if a CDN is used to
|
// // from what our page is served on. This might happen if a CDN is used to
|
||||||
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
|
// // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|||||||
Reference in New Issue
Block a user