[w3c/ServiceWorker] A WindowClient close or terminate method perhaps? (#1567)

"You can close a window from the main thread, but only if it's open by another document"

What about those "go to your mail box and verify your code/identity" scenarios where a page is open by another application. and the verification page then becomes useless when clicking on a verification link in your mail client?

Or a friend is calling you face to face - click on this desktop notification to answer (open) the conversation. 
When the conversation ends you want to close the window. in that senario you would have wish you had open the window from another tab so the it has a opener and could be closed.
In this senario you have a opener (a desktop notification triggered by a service worker) but the service worker can't close the window on itself.

Could Service Worker have a more secure context and awareness of which window clients are open that it could circumvent the restriction of what `window.close()` has?

I know it could be bad to close the client if it where the last tab open, but what if browser instead open about:blank or the home screen in those scenarios so the browser itself would not closed down? child frames would switch to about:blank

maybe instead of a `.close()` there was a `.terminate()` method that could terminate both tabs and other web workers.

-- 
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/ServiceWorker/issues/1567

Received on Saturday, 20 February 2021 18:49:16 UTC