vh-check icon indicating copy to clipboard operation
vh-check copied to clipboard

Does not work correctly in a PWA standalone web app

Open jarmo opened this issue 5 years ago • 2 comments

When having a PWA standalone app (display property value is standalone in manifest.json as written in here https://developer.mozilla.org/en-US/docs/Web/Manifest/display) then this library does not work as expected - since address bar does not exist then things are calculated incorrectly.

jarmo avatar Jul 28 '20 21:07 jarmo

Also having this issue, inspecting from Safari, on the initial load of the page, there is no --vh-offset var in the style attribute of the html tag. After I refresh the page from the web inspector of Safari, then the --vh-offset becomes available.

https://github.com/Hiswe/vh-check/assets/772730/6442644a-7222-4c42-a9d8-c89334afa572

laygir avatar Mar 11 '24 10:03 laygir

This seems to solve the issue, at least so far.

document.addEventListener('DOMContentLoaded', () => {
  vhCheck();
});

laygir avatar Mar 11 '24 10:03 laygir