WICG / nav-speculation

Proposal to enable privacy-enhanced preloading
https://wicg.github.io/nav-speculation/
Other
152 stars 35 forks source link

Delay registerProtocolHandler() until activation #283

Closed nhiroki closed 10 months ago

nhiroki commented 11 months ago

This delays registerProtocolHandler() and unregisterProtocolHandler() until activation. To handle SyntaxError DOMException and SecurityError DOMException during normalizing parameters, this adds custom steps instead of [DelayWhilePrerendering].

github-actions[bot] commented 11 months ago
Preview: - [prerendering.html](https://storage.googleapis.com/spec-previews/WICG/nav-speculation/pull/283/head/prerendering.html) ([diff](https://storage.googleapis.com/spec-previews/WICG/nav-speculation/pull/283/diff/prerendering.html) [base](https://storage.googleapis.com/spec-previews/WICG/nav-speculation/pull/283/base/prerendering.html))
nhiroki commented 11 months ago

Regarding the IPR failure, I'm now requesting to join the group.

domenic commented 11 months ago

To handle SyntaxError DOMException and SecurityError DOMException during normalizing parameters, this adds custom steps instead of [DelayWhilePrerendering].

We have previously had some discussions about this and thought it was OK to delay even such basic argument validation. See https://github.com/WICG/nav-speculation/pull/63#pullrequestreview-663708345 .

But, I don't think anyone felt too strongly about this. Do you think we should do the validation early?

jeremyroman commented 10 months ago

I think the difference is that these aren't promise-returning operations.

If they were, then the exception would still be handled by the calling code. Since they're synchronous, though, we can't let author code handle the exception if we don't throw it synchronously, here. Instead it would be either unhandled or become an error event, both of which seem less convenient and more likely to break author code.

domenic commented 10 months ago

Oh, that's a great point, and I'm sorry for missing it. Then, this LGTM!

nhiroki commented 10 months ago

Jeremy perfetcly summarized what I wanted to say. Thanks!