Re: [w3c/browser-payment-api] should .show() be user gated? (#486)

@marcoscaceres,

> What's an "active element"?

I took that from the [Mozilla dev docs](https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus) on `Document.hasFocus`:

> When viewing a document, an element with focus is always the active element in the document, but an active element does not necessarily have focus. For example, an active element within a popup window that is not the foreground does not have focus.
> 
> Return Value
> 
> false if the active element in the document has no focus; true if the active element in the document has focus.

> That's why we have an attribute on iframes to explicitly allow this.

You missed my edit in there since you replied via email -- I added `(cross-domain)` as a qualifier for the iframe; I don't think you can access the `document` property of `window.top` in that case to even check the focus. If you *could*, which the native browser code presumably can, then I would expect this to work -- which is why I said it seemed correct in spirit :).

> Your dev tools have focus ^_^ try it with setTimeout and actually focusing the document by clicking on it.

Yeah, I had an edit after my original reply where I noticed the same thing and used `setInterval` to test.

-- 
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/browser-payment-api/issues/486#issuecomment-292198544

Received on Thursday, 6 April 2017 14:50:36 UTC