chrome PWA 支持.

This commit is contained in:
lijiahang
2024-05-22 12:50:30 +08:00
parent 35ee4faffc
commit ca8e629e4c
17 changed files with 1982 additions and 30 deletions

View File

@@ -5,6 +5,13 @@ export const isSecureEnvironment = (() => {
return window.location.protocol === 'https:' || window.location.hostname === 'localhost';
})();
// 当前是否为单应用模式 PWA
export const isStandaloneMode = (() => (
(window.matchMedia('(display-mode: standalone)').matches)
|| ((window.navigator as any).standalone)
|| document.referrer.includes('android-app://')
) === true)();
// http base url
export const httpBaseUrl = (() => {
const configBase = import.meta.env.VITE_API_BASE_URL;