-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mistake in source code #20
Comments
do you have any specific problem though? I think current state works with both old and newer Safari and the fix went in and it got tested to work everywhere ... I am saying this because while I fully agree there is a typo, I don't know enough of their internal changes to be sure if I change that, we'll have new issues on Safari. |
No I have nothing to say more :) just that it's a bug waiting to happen, probably. |
AFAIK so far no browser complained, but I hear you ... although things work now. I will eventually fix this and push major (or minor, if I am still behind |
Unfortunately I recently canceled my browserstack subscription. Do you know you can ask them to give this project free open source subscription ? |
I have one already, that's why I've said, everything is fine. |
Since epiphany-browser is kind of webkit, I gave it a try... |
Imagine I use GNOME Web as my daily driver |
Well then that's odd. I'm diffing v1.2.0 / v1.3.0 to see what broke my setup |
Ha damn again it's a problem on my side. I'm loading the polyfill somewhat too late. |
FWIW my issue was that I was detecting the need to load the customElement polyfill using this code:
Which makes the corresponding detections fail in @ungap/custom-element, because extends-br is already registered. |
The best way to run this polyfill for Safari or WebKit only is to stick this inline script as the first one on any page (within the <script>
if (!(self.chrome || self.netscape))
document.write('<script src="https://cdn.jsdelivr.net/npm/@ungap/custom-elements/es.js"></'+'script>');
</script> arguably you can use the same trick to bring in just https://cdn.jsdelivr.net/npm/@webreflection/custom-elements-builtin/es.js without even needing to feature-detect as it's clear at this point Apple won't ever implement builtin extends. |
CodePen Live Demo https://codepen.io/WebReflection/pen/wvNzOmr?editors=1000 |
Thanks for the additional infos. However I'm loading a bunch of other polyfills (mostly from polyfill.io's detectSource fields) before actually executing my library. It's a bit convoluted but it avoids user-agent detection, and all polyfills are equal :) |
I haven't used user agent sniffing, I've used proprietary fields per browser ... I am not parsing a string, I am checking the env 😉 Like I've said, that is the best way to land this poly for Safari only and no network request even ever happens in Chrome or Firefox ... the CDN caches that too so it's irrelevant for your users. In short, do what you want, but the best wayfor this polyfil is the one I've suggested there, actually the CodePen example is even better because it doesn't trash any entry in the |
https://github.com/WebReflection/custom-elements/blob/0acfb63eab710719e84ba8773f0af689f091dbfd/template/index.js#L9
The text was updated successfully, but these errors were encountered: