Add Event for non-legacy browsers with `onlyLegacy: true`
See original GitHub issueHi, thank you for building + maintaining such a great ponyfill!
I have some code (initializing a Vue app) that I want to have run as early as possible, but not before the cssVars
call completes on legacy browsers. I also don’t want to have to add onlyLegacy: false
because I don’t want extra work to be done in non-legacy browsers. However, handlers like onComplete
don’t trigger at all in non-legacy browsers, so adding my initialization code to onComplete
means that it never runs in non-legacy browsers.
Could you add a handler that triggers after cssVars
call is done, even in non-legacy browsers and with onlyLegacy: true
set? It could either be a handler called only when cssVars
bails early or one that’s called 100% of the time.
Thank you!
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
css-vars-ponyfill - GitHub Pages
onlyLegacy is false , modern browsers with native support for CSS custom ... XML object by setting properties, calling methods, or adding event...
Read more >Passive event listeners | Can I use... Support tables for HTML5 ...
Event listeners created with the passive: true option cannot cancel ( preventDefault() ) the events they receive. Primarily intended to be used with...
Read more >Diff - af526ec9c36dfbb3c244ad03f8df79311e5ba03c^2 ... - Google Git
+ * + * @param legacy true if only legacy advertisements will be returned + */ + public Builder setLegacy(boolean legacy) { +...
Read more >https://www.ietf.org/tools/idnits?url=https://www....
Each node may have 162 zero, one or more source identifiers (SSRCs) used to either identify 163 a real media source such as...
Read more >Pamela, - Intel Communities
In the non-Legacy builds those core plugins are included in the emulator and the ... There is no longer a legacy build for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sounds good to me then. I’ll take care of this early next week.
Thanks for the quick feedback, everyone!
Makes sense. Here are my initial thoughts:
onDone
onComplete
, if applicable)hasNativeSupport
andbenchmark
Examples
The
onComplete
callback will continue to be where you access the CSS output, DOM elements, and custom property key/value pairs processed by the ponyfill, while theonDone
callback can be used to invoke post-ponyfill code in both modern and legacy browsers:If you don’t need to access the values returned by the
onComplete
callback, you can move all post-ponyfill logic into theonDone
callback and use thehasNativeSupport
argument to target modern and/or legacy browsers:The only bummer is that this will require a major version bump since the
benchmark
value is being moved from theonComplete
callback to theonDone
callback.Thoughts?
Pinging @pseudoramble, @freitasskeeled, and @evry-johber since they created issues related to this same topic earlier.