Closed pp-koch closed 1 year ago
The extension only supports "error" events in the CoilPreview which is currently tracking (though not strictly) the #193 PR
Firefox natively supports error events on link tags, but Chrome and Safari do not.
Interesting. Are there any events for links that are only emitted for certain values of "rel" ?
Interesting question. Turns out Firefox fires an error event only for rel="stylesheet", and not for any other. Chrome and Safari fire nothing. Tested only on Mac.
What's the shape of the error?
Any details ? or just Event('error')
Nope, nothing useful. See https://quirksmode.org/link-errors.html again.
By default the error event on stylesheet links in Firefox does not bubble up. But I think the error event that the extension fires should bubble.
Correct, it will bubble.
For where the “error” event is fired, see the spec link in #193 … search for “fire an event named "error" at element.”
(Responding from my phone)
I don't think I made 'error' bubble in the CoilPreview ...
Might be worth mentioning it explicitly, cause for the onmonetization even where I did make it bubble (cause it was obvious that it should) I had to set some option on the Event constructor iirc
Yes, let me make that explicit.
Ok, updated the PR... good catch on that @sublimator: it's indeed defaulted to not bubble by the DOM spec. Now fixed 🙏
@AlexLakatos, when you are back online, could you update the static doc?
Updated the static doc.
oh wait... I think I screwed this up. load
and error
shouldn't bubble, only "monetization" should bubble.
Yeah, I was just coming here wondering about that lol
Is it because it's not a generic event ? It would confusion with other error/load handlers right ? window.onload would fire etc??
Is it because it's not a generic event ?
Correct.
It would confusion with other error/load handlers right ?
Exactly.
window.onload would fire etc??
Precisely 😱
ok, fixed in the PR.
Resolved by #193
The spec does not define an error event for the links. Will the extension support them nonetheless? That's currently unclear to me.
Firefox natively supports error events on link tags, but Chrome and Safari do not.
If the extension supports them, might they eventually make their way into the spec? I need to figure out if I have to treat the error event at the same level as the monetization event (i.e. 'the link tag supports two events') or that error should go on the Extension page, separate from the spec documentation.