react-new-window icon indicating copy to clipboard operation
react-new-window copied to clipboard

onUnload triggers as soon as window is opened on Safari

Open superandrew213 opened this issue 6 years ago • 11 comments

See example here: https://codesandbox.io/s/green-lake-n13i3

Use this url to test: https://n13i3.csb.app

Only happens on safari when using url.

superandrew213 avatar Oct 31 '19 01:10 superandrew213

The reason is that beforeonunload is triggered in different situations on safari see: https://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/ By replacing this.window.addEventListener('beforeunload', () => this.release()) with this.window.addEventListener('ononload', () => this.release()) the issue would be solved.

MkDevelop avatar Dec 06 '19 16:12 MkDevelop

same issue on chrome here is example https://codesandbox.io/s/pensive-https-vnqin

itzmanish avatar Mar 27 '20 05:03 itzmanish

Any way we can get this in a new release @rmariuzzo ? Seems like a quick fix.

joelrojo avatar Oct 04 '20 19:10 joelrojo

@joelrojo will review it soon

rmariuzzo avatar Oct 05 '20 02:10 rmariuzzo

+1 for this to be fixed!

leehsueh avatar Nov 28 '20 19:11 leehsueh

same issue on Firefox

Rigel772 avatar Dec 16 '20 10:12 Rigel772

+1 on a fix for this

rchiba avatar Feb 17 '21 18:02 rchiba

@rchiba were you able to reproduce this? Im curious to know if this is a specific version of a browser or it happens for all browsers

dannypaz avatar Feb 23 '21 09:02 dannypaz

Has there been an official fix for this?

mattfranciswork0 avatar Aug 22 '21 01:08 mattfranciswork0

Same issue on firefox 2021. Is the lib dead?

kimgysen avatar Dec 30 '21 10:12 kimgysen

The issue is still happening in Safari Version 15.2

gentlementlegen avatar Mar 14 '22 15:03 gentlementlegen

I just tried to reproduce this issue on Chrome, Safari and Firefox without success. It seems to have gone with recent published changes. Try updating to latest version of this package.

Note: before recent change, I did notice this issue.

rmariuzzo avatar Nov 27 '22 05:11 rmariuzzo