Re: [w3c/manifest] Provide a way to not open a link in the PWA, in the moment (#989)

Thanks for the reply.

![ezgif-2-951fbd944edc](https://user-images.githubusercontent.com/9629574/126951208-bc46bf7b-e29f-4c83-9747-ca503da66015.gif)

After clicking the "Login using xxx" button, I'm executing the following:

    this.authWindow = window.open(`${this.baseUrl}/web/${this.apiVersion}/Account/${this.action}/${medium}/${this.platform}`, '_blank', 'width=600,height=400');
    // For example
    // this.authWindow = window.open(`https://example.com/web/v3/Account/connect/web/Microsoft`, '_blank', 'width=600,height=400');

Since **https://example.com** is the root of my PWA, you can see that `window.open` is opening my PWA instead of just a new tab. After signing in into the Microsoft/Facebook/... login, a script is executed:

```
<!DOCTYPE html>
<html lang="en">
<head>
 <title>Bezig met verwerken...</title>
 <script type="text/javascript">
        var message = {
            status: @( (int)Model.Status ),
            medium: "@Model.Medium",
            platform: "@Model.Platform",
            error: "@Model.Error",
            errorDescription: "@Model.ErrorDescription"
        };
        window.opener.postMessage(JSON.stringify(message), "https://example.com");
 </script>
</head>
<body>
</body>
</html>
```

But since this url has been opened in the PWA instead of a browser window, the message doesn't arrive in the opener's window.

> opener -> opens `https://example.com/signin-microsoft` -> PWA is being launched -> Link with opener is broken.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/989#issuecomment-886461131

Received on Monday, 26 July 2021 07:47:55 UTC