jquintozamora / polyfill-io-feature-detection Goto Github PK
View Code? Open in Web Editor NEWFeature detection in the browser before loading polyfill using services like polyfill.io
License: MIT License
Feature detection in the browser before loading polyfill using services like polyfill.io
License: MIT License
Hi. I'm trying to use this package for loading Intl polyfill. For correct work, it needs also Intl.~locale.[locale]
to be loaded. But if I try to add any locale to features I get the next message:
Feature Intl.~locale.en-US can not be detected because it has not JavaScript API.
What if instead of skipping features with ~
this tool will include them in the query string for polyfill.io if the root feature (like Intl
for Intl.~locale.en-US
) is not supported by the browser?
Hi,
You have a 'let' keyword in index.js. So when using uglify, there is an exception.
Could you modify it to var?
Antony
For the sake of supporting polyfill.io fully, you may want to support IE7 & IE8 in the code base. Two things are needed :
loadScript
Features impacted (as I could tell):
Array.prototype.filter
Array.prototype.map
String.prototype.lastIndexOf
Solutions:
contains
)detectBrowserUnsupportedFeatures
couldn't even runProposed version that supports old IE:
function loadScript(src, done) {
var finished = false
function handleLoad () {
if (!finished) {
finished = true
done(src)
}
}
function handleReadyStateChange () {
if (!finished) {
if (script.readyState === 'complete') {
handleLoad()
}
}
}
function handleError () {
if (!finished) {
finished = true
done(new Error('Failed to load script ' + src))
}
}
var script = document.createElement('script')
script.onload = handleLoad
script.type = 'text/javascript'
script.onreadystatechange = handleReadyStateChange
script.onerror = handleError
script.src = src
document.head.appendChild(script)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.