Skip to content
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

Experiment: Admin PWA #33102

Merged
merged 13 commits into from
Jul 5, 2021
Prev Previous commit
Next Next commit
Try to prioritise maskable icon
  • Loading branch information
ellatrix committed Jul 3, 2021
commit 19cb71afc9c33e102720a8f392db93120fd439c5
24 changes: 12 additions & 12 deletions lib/pwa-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,44 +112,44 @@ window.addEventListener( 'load', () => {
const svgElement = createSvgElement( logo );

Promise.all( [
// The "normal" icon should be round. This is used for Chrome
// Desktop PWAs. To do: check which sizes are really needed.
// The maskable icon should have its background filled. This is used
// for iOS. To do: check which sizes are really needed.
...[ 180, 192, 512 ].map( ( size ) =>
createIcon( {
svgElement,
size: 180,
color,
backgroundColor,
circle: true,
} ).then( ( base64data ) => {
manifest.icons.push( {
src: base64data,
sizes: size + 'x' + size,
type: 'image/png',
purpose: 'any',
purpose: 'maskable',
} );

// iOS doesn't seem to look at the manifest.
if ( size === 180 ) {
addAppleTouchIcon( size, base64data );
}
} )
),
// The maskable icon should have its background filled. This is used
// for iOS. To do: check which sizes are really needed.
// The "normal" icon should be round. This is used for Chrome
// Desktop PWAs. To do: check which sizes are really needed.
...[ 180, 192, 512 ].map( ( size ) =>
createIcon( {
svgElement,
size: 180,
color,
backgroundColor,
circle: true,
} ).then( ( base64data ) => {
manifest.icons.push( {
src: base64data,
sizes: size + 'x' + size,
type: 'image/png',
purpose: 'maskable',
purpose: 'any',
} );

// iOS doesn't seem to look at the manifest.
if ( size === 180 ) {
addAppleTouchIcon( size, base64data );
}
} )
),
] ).then( () => {
Expand Down