Skip to content

Update isStandAlone check for Chrome

fixes #234 (closed) fixes #235 (closed) fixes #240 (closed)

There was a very simple answer to this bug.

I am not sure why, but the service worker uses "display": "fullscreen", but in Chrome the check that determines if the application is running as an installed PWA needs to check that the display mode is "standalone".

https://developer.mozilla.org/en-US/docs/Web/CSS/@media/display-mode

Tested in as many browsers as possible (on mobile and desktop), even though this issue was only reported in Chrome:

  • Chrome
  • Safari
  • Firefox
  • Edge

To test perform these steps in order:

  1. (issue-234) Load application with legacy hash, This should have a search for 2020 with mag 7+ (five total events) http://localhost:4200/#%7B"autoUpdate"%3A%5B%5D%2C"basemap"%3A"terrain"%2C"feed"%3A"1594236680335"%2C"listFormat"%3A"dyfi"%2C"mapposition"%3A%5B%5B-89.95496591779522%2C-42.890625%5D%2C%5B89.95551519187772%2C402.890625%5D%5D%2C"overlays"%3A%5B"ushazard"%5D%2C"restrictListToMap"%3A%5B%5D%2C"search"%3A%7B"id"%3A"1594236680335"%2C"name"%3A"Search%20Results"%2C"isSearch"%3Atrue%2C"params"%3A%7B"starttime"%3A"2020-01-01%2000%3A00%3A00"%2C"endtime"%3A"2020-07-08%2023%3A59%3A59"%2C"minmagnitude"%3A7%2C"orderby"%3A"time-asc"%7D%7D%2C"sort"%3A"oldest"%2C"timezone"%3A"local"%2C"viewModes"%3A%5B"list"%2C"map"%2C"settings"%5D%2C"event"%3Anull%7D
  2. (issue-235) Clear the URL parameters and load the page, we should see the default application parameters load (search will no longer exist from step 1 above. http://localhost:4200/
  3. (issue-240) Load the application using a URL with parameters already set , this should load values from the URL and not rely on localStorage to maintain the values already set in Step 2. http://localhost:4200/?extent=-14.43468,-122.87109&extent=69.44213,-67.14844&autoUpdate=false&magnitude=all&format=dyfi&sort=largest&listOnlyShown=false&showPlateBoundaries=false&showUSHazard=true&baseLayer=ocean&timeZone=local&settings=true
Edited by Edward J Hunter

Merge request reports