Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove or explain usages of unload and beforeunload listeners #23634
After doing some research on this,
More context on this.
The viewer usage – on the Google AMP Viewer side at least – was added to detect whether an AMP document unloads inside a viewer (and it shouldn't) and displays an error.
Based on my limited understanding, there is no usage of BFCache inside the viewer and since the
I think @wassgha's analysis is correct. The unload event is used specifically in the case of an AMP Viewer. While it is extremely rare, it really shouldn't be allowed since The AMP Viewer does not expect to contain non-AMP content.
I'm not familiar with the use of