-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pwa support for elastic skin #9354
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//remember to increment the version # when you update the service worker | ||
const version = "1.00", | ||
preCache = "PRECACHE-" + version, | ||
cacheList = [ "/" ]; | ||
|
||
/* | ||
create a list (array) of urls to pre-cache for your application | ||
*/ | ||
|
||
/* Service Worker Event Handlers */ | ||
|
||
self.addEventListener( "install", function ( event ) { | ||
|
||
console.log( "Installing the service worker!" ); | ||
|
||
self.skipWaiting(); | ||
|
||
event.waitUntil( | ||
|
||
caches.open( preCache ) | ||
.then( cache => { | ||
|
||
cache.addAll( cacheList ); | ||
|
||
} ) | ||
|
||
); | ||
|
||
} ); | ||
|
||
self.addEventListener( "activate", function ( event ) { | ||
|
||
event.waitUntil( | ||
|
||
//wholesale purge of previous version caches | ||
caches.keys().then( cacheNames => { | ||
cacheNames.forEach( value => { | ||
|
||
if ( value.indexOf( version ) < 0 ) { | ||
caches.delete( value ); | ||
} | ||
|
||
} ); | ||
|
||
console.log( "service worker activated" ); | ||
|
||
return; | ||
|
||
} ) | ||
|
||
); | ||
|
||
} ); | ||
|
||
self.addEventListener( "fetch", function ( event ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Roundcube doesn't use |
||
|
||
event.respondWith( | ||
|
||
fetch( event.request ) | ||
|
||
/* check the cache first, then hit the network */ | ||
/* | ||
caches.match( event.request ) | ||
.then( function ( response ) { | ||
|
||
if ( response ) { | ||
return response; | ||
} | ||
|
||
return fetch( event.request ); | ||
} ) | ||
*/ | ||
); | ||
|
||
} ); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,47 @@ | |
} catch (e) { } | ||
</script> | ||
<roundcube:endif /> | ||
<roundcube:if condition="env:action != 'print' && !config:devel_mode" /> | ||
<link rel="manifest" href="/manifest.json"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one high-res icon should be enough, also it is much easier to replace it with a custom icon then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'd have to discuss this point with the guys that defined PWA I guess 😊 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://developer.apple.com/design/human-interface-guidelines/app-icons#App-icon-sizes says:
For MS Windows and Android, at least 512x512 pixels are required. So to me, too, this sounds like way fewer icons are possible to make it work. I guess for optimal icon displaying more sizes are better, but for this PR to be mergeable we need to find a solution that keeps changing the icon feasible. (Nothing stops anyone from adding more icons at all.) @the0ne Would you be willing to change this to reach a possible compromise? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be really happy if somebody would step in and take care of those changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, thanks for the feedback! |
||
<link rel="apple-touch-icon" href="/images/ios/120.png"> | ||
<link rel="apple-touch-icon" sizes="152x152" href="/images/ios/152.png"> | ||
<link rel="apple-touch-icon" sizes="180x180" href="/images/ios/180.png"> | ||
<link rel="apple-touch-icon" sizes="120x120" href="/images/ios/120.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_15_Pro_Max__iPhone_15_Plus__iPhone_14_Pro_Max_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_15_Pro__iPhone_15__iPhone_14_Pro_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_14_Plus__iPhone_13_Pro_Max__iPhone_12_Pro_Max_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_14__iPhone_13_Pro__iPhone_13__iPhone_12_Pro__iPhone_12_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_13_mini__iPhone_12_mini__iPhone_11_Pro__iPhone_XS__iPhone_X_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_11_Pro_Max__iPhone_XS_Max_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/iPhone_11__iPhone_XR_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/images/splash/iPhone_8_Plus__iPhone_7_Plus__iPhone_6s_Plus__iPhone_6_Plus_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/iPhone_8__iPhone_7__iPhone_6s__iPhone_6__4.7__iPhone_SE_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/4__iPhone_SE__iPod_touch_5th_generation_and_later_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/12.9__iPad_Pro_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/11__iPad_Pro__10.5__iPad_Pro_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/10.9__iPad_Air_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/10.5__iPad_Air_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/10.2__iPad_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/9.7__iPad_Pro__7.9__iPad_mini__9.7__iPad_Air__9.7__iPad_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/images/splash/8.3__iPad_Mini_landscape.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_15_Pro_Max__iPhone_15_Plus__iPhone_14_Pro_Max_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_15_Pro__iPhone_15__iPhone_14_Pro_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_14_Plus__iPhone_13_Pro_Max__iPhone_12_Pro_Max_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_14__iPhone_13_Pro__iPhone_13__iPhone_12_Pro__iPhone_12_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_13_mini__iPhone_12_mini__iPhone_11_Pro__iPhone_XS__iPhone_X_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_11_Pro_Max__iPhone_XS_Max_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/iPhone_11__iPhone_XR_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/images/splash/iPhone_8_Plus__iPhone_7_Plus__iPhone_6s_Plus__iPhone_6_Plus_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/iPhone_8__iPhone_7__iPhone_6s__iPhone_6__4.7__iPhone_SE_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/4__iPhone_SE__iPod_touch_5th_generation_and_later_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/12.9__iPad_Pro_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/11__iPad_Pro__10.5__iPad_Pro_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/10.9__iPad_Air_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/10.5__iPad_Air_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/10.2__iPad_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/9.7__iPad_Pro__7.9__iPad_mini__9.7__iPad_Air__9.7__iPad_portrait.png"> | ||
<link rel="apple-touch-startup-image" media="screen and (device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/images/splash/8.3__iPad_Mini_portrait.png"> | ||
<roundcube:endif /> | ||
</head> | ||
<body class="task-<roundcube:exp expression="env:error_task ?: env:task ?: 'error'"> action-<roundcube:exp expression="asciiwords(env:action, true, '-') ?: 'none'">"> | ||
<roundcube:if condition="!env:framed || env:extwin" /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the logging from this file (or make it helpful beyond debugging).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this sets up caching network data, but that data doesn't ever get used, right? So please either complete that feature or remove it.