amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-web-push: unnecessary pop-up window for push notification permission request for AMP pages on origin/SxG

Open westonruter opened this issue 5 years ago • 2 comments

On a page using amp-web-push, when a user clicks on the amp-web-push-widget button a pop-up window is opened. The browser's push notification permission request is made from this popup which loads a permission dialog page.

Presumably the key reason for the popup is so that an AMP page served from an AMP Cache will be able to install the origin site's service worker and issue the permission request from the origin domain, even though the user initiated the push notification subscription from a page served on the cache.

However, is this popup window needed when the AMP page is being served on from origin (or via SxG)? Opening popups seems like it should generally be avoided if possible. If there is no technical reason for the popup on non-cache AMP pages, can amp-web-push have logic to issue the permission requests from the AMP page's current window directly without the popup when on origin?

This will become more of an issue as more sites go AMP-first and/or roll out SxG.

Screencast from @jeffersonrabb showing the current popup behavior on a page served from origin: https://cloudup.com/cyyfKRs0tG7 (source: https://github.com/Automattic/newspack-plugin/pull/417)

westonruter avatar Mar 19 '20 01:03 westonruter

@micajuine-ho and @dmanek is this one that one of you can take on?

nainar avatar Feb 03 '21 21:02 nainar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 12 '22 00:08 stale[bot]