html icon indicating copy to clipboard operation
html copied to clipboard

Should `<a target="_blank">` and `window.open` consume the transient activation?

Open EdgarChen opened this issue 1 year ago • 3 comments

What is the issue with the HTML Standard?

https://html.spec.whatwg.org/multipage/document-sequences.html#the-rules-for-choosing-a-navigable checks for the transient activation without consuming it. Chromium seems to consume the transient activation in both <a target="_blank"> and window.open cases per result of test. Gecko only consumes the activation in window.open case. Webkit doesn't consume the activation in either case.

EdgarChen avatar Jan 29 '24 21:01 EdgarChen

This seems like a good idea. Maybe @mustaqahmed can recall why we didn't specify this in the first place. Was it just because it wasn't interoperable, so we weren't sure everyone would be willing to do it?

domenic avatar Jan 30 '24 09:01 domenic

Mentioning consumption in the spec makes sense to me.

... why we didn't specify this in the first place. Was it just because it wasn't interoperable, so we weren't sure everyone would be willing to do it?

That matches my understanding: popup blockers came into existence "organically" w/o a spec, and each browser had a slightly different implementation that just worked.

I believe another blocker for a possible consensus here is that popup blockers use few other signals (I mean "other than just user activation") like how allowed-sites are handled and the number or the frequency of popup requests. The list of signals used by each browser seems different (as far as I could sense from my 7-yr old experiment). Cataloging all signals used by each browsers could be a good first step if we expect to standardize popup blockers.

mustaqahmed avatar Jan 30 '24 15:01 mustaqahmed

I'll likely start a PR for this soon if that sounds good?

CanadaHonk avatar Jul 01 '24 12:07 CanadaHonk