Browse Source

Fix manifest path

Fix Safari 304 Not Modified
master
Eduard Kuzmenko 3 years ago
parent
commit
61761effe4
  1. 2
      src/components/sidebarLeft/index.ts
  2. 2
      src/config/app.ts
  3. 4
      src/index.hbs
  4. 2
      src/lang.ts
  5. 9
      src/lib/mtproto/mtproto.service.ts

2
src/components/sidebarLeft/index.ts

@ -178,7 +178,7 @@ export class AppSidebarLeft extends SidebarSlider { @@ -178,7 +178,7 @@ export class AppSidebarLeft extends SidebarSlider {
icon: 'char w',
text: 'ChatList.Menu.SwitchTo.Webogram',
onClick: () => {
location.href = 'https://web.telegram.org/';
location.href = 'https://web.telegram.org/?legacy=1';
},
verify: () => App.isMainDomain
}];

2
src/config/app.ts

@ -13,7 +13,7 @@ const App = { @@ -13,7 +13,7 @@ const App = {
id: 1025907,
hash: '452b0359b988148995f22ff0f4229750',
version: '0.5.6',
langPackVersion: '0.2.1',
langPackVersion: '0.2.2',
langPack: 'macos',
langPackCode: 'en',
domains: [] as string[],

4
src/index.hbs

@ -13,14 +13,14 @@ @@ -13,14 +13,14 @@
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicon-32x32.png?v=jw3mK7G9Ry">
<!--<link rel="icon" type="image/png" sizes="192x192" href="assets/img/android-chrome-192x192.png?v=jw3mK7G9Ry">
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicon-16x16.png?v=jw3mK7G9Ry">-->
<link rel="manifest" href="assets/img/site.webmanifest?v=jw3mK7G9Ry">
<link rel="manifest" href="site.webmanifest?v=jw3mK7G9Ry">
<link rel="mask-icon" href="assets/img/safari-pinned-tab.svg?v=jw3mK7G9Ry" color="#3390ec">
<!--<link rel="shortcut icon" href="assets/img/favicon.ico?v=jw3mK7G9Ry">-->
<meta name="apple-mobile-web-app-title" content="Telegram WebK">
<meta name="application-name" content="Telegram WebK">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="msapplication-TileImage" content="assets/img/mstile-144x144.png?v=jw3mK7G9Ry">
<meta name="msapplication-config" content="assets/img/browserconfig.xml?v=jw3mK7G9Ry">
<meta name="msapplication-config" content="browserconfig.xml?v=jw3mK7G9Ry">
<meta name="theme-color" content="#ffffff">
<meta name="color-scheme" content="light">
{{# each htmlWebpackPlugin.files.css }}

2
src/lang.ts

@ -43,7 +43,7 @@ const lang = { @@ -43,7 +43,7 @@ const lang = {
"Chat.Search.NoMessagesFound": "No messages found",
"Chat.Search.PrivateSearch": "Private Search",
//"ChatList.Menu.Archived": "Archived",
"ChatList.Menu.SwitchTo.Webogram": "Switch to Webogram",
"ChatList.Menu.SwitchTo.Webogram": "Switch to Old Version",
"ChatList.Menu.SwitchTo.Z": "Switch to Z version",
"ConnectionStatus.ReconnectIn": "Reconnect in %ds, %s",
"ConnectionStatus.Reconnect": "reconnect",

9
src/lib/mtproto/mtproto.service.ts

@ -63,9 +63,16 @@ async function requestCache(event: FetchEvent) { @@ -63,9 +63,16 @@ async function requestCache(event: FetchEvent) {
return file;
}
const response = await fetch(event.request);
let response = await fetch(event.request);
if(isCorrectResponse(response)) {
cache.put(event.request, response.clone());
} else if(response.status === 304) { // possible fix for 304 in Safari
const url = event.request.url.replace(/\?.+$/, '') + '?' + (Math.random() * 100000 | 0);
const request = new Request(url);
response = await fetch(request);
if(isCorrectResponse(response)) {
cache.put(request, response.clone());
}
}
return response;

Loading…
Cancel
Save