GithubHelp home page GithubHelp logo

wessberg / polyfiller Goto Github PK

View Code? Open in Web Editor NEW
125.0 5.0 5.0 14.84 MB

Never worry about polyfills again.

Home Page: https://polyfill.app

License: MIT License

JavaScript 68.00% TypeScript 31.82% Shell 0.01% HTML 0.17%
polyfills shim javascript web webservice typescript polyfill-app polyfills-as-a-service

polyfiller's Issues

Invalid certificate error shown on Safari iOS 9 and under devices

image

Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “polyfill.app” which could put your confidential information at risk.
Error is shown and request is blocked.

Seems to work in major and current browsers. Not sure how long this has been an issue.

ResizeObserver is not polyfilled even though `|force` is used

This is my current script tag:

<script crossorigin src="https://polyfill.app/api/polyfill?features=es,fetch,pointer-event,scroll-behavior,resize-observer|force"></script>

An hour ago I got this error on Sentry:

Screen Shot 2020-03-05 at 9 27 53 AM

For some reason ResizeObserver is not being polyfilled.

This is the user agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1

Screen Shot 2020-03-05 at 9 28 24 AM

TypeError: Invalid character in header field name

I cannot reproduce this but I got this error from one of my users in Sentry

Does this make sense to you?

Screen Shot 2020-04-02 at 12 24 49 PM

TypeError: Invalid character in header field name
--
arguments | [{"message":"Invalid character in header field name","name":"TypeError","stack":"TypeError: Invalid character in header field name\n    at normalizeName (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:75432)\n    at Headers.append (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76247)\n    at Headers.<anonymous> (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76159)\n    at Array.forEach (<anonymous>)\n    at new Headers (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76131)\n    at new Request (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:81348)\n    at https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:83734\n    at new Promise (<anonymous>)\n    at fetch (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:83685)\n    at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:914256\n    at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:175882\n    at u (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471028)\n    at Generator._invoke (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:470781)\n    at Generator.forEach.e.<computed> [as next] (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471385)\n    at r (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34154)\n    at s (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34357)\n    at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34416\n    at new Promise (<anonymous>)\n    at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34297\n    at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:176085\n    at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:172971\n    at u (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471028)\n    at Generator._invoke (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:470781)\n    at Gene..."}]

ES.string not polyfilled on QQ browser

Browser:

Screen Shot 2020-04-06 at 12 21 43 PM

User agent:


Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 QBCore/4.0.1301.400 QQBrowser/9.0.2524.400 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2875.116 Safari/537.36 NetType/WIFI MicroMessenger/7.0.5 WindowsWechat

Error:

Screen Shot 2020-04-06 at 12 21 52 PM

Code:

<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior,es"></script>

It should polyfill es --> es.string --> padStart but it doesn't.

Intl.ListFormat not being returned for Chrome 71 in Xiaomi phone

The error can be reproduced as the following:

const request = require("request");

function withUserAgent(userAgent) {
    return {
        url: "https://polyfill.app/api/polyfill?features=intl.list-format",
        headers: {
            "User-Agent": userAgent
        }
    };
}

// this is a real user agent from mi browser in a Xiaomi phone
const chrome71xiaomi = "Mozilla/5.0 (Linux; U; Android 10; en-us; SM-G975F Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.1.3-g";

// this is a real user agent from a Pixel 2 XL
const chrome71      = "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.141 Mobile Safari/537.36";

// This one is just like the above one, but with "XiaoMi/MiuiBrowser/12.1.3-g" added at the end
const chrome71fake  = "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.1.3-g";

request(
    withUserAgent(chrome71xiaomi),
    (error, response, body) => console.log("chrome71xiaomi: ", body.length)
);

request(
    withUserAgent(chrome71),
    (error, response, body) => console.log("chrome71: ", body.length)
);

request(
    withUserAgent(chrome71fake),
    (error, response, body) => console.log("chrome71fake: ", body.length)
);

The resulting log is:

chrome71xiaomi:  0
chrome71fake:  0
chrome71:  15477

Which is obviously an error.

Error in Web Service API Reference

An Error occurred.
Code: 500
ENOSPC: no space left on device, open '/tmp/@wessberg/polyfiller/production/85d70e21d508715396c51d67992a98f7ced0eac7'

Do you want the domain pollyfiller.io ?

@wessberg - I have the domain polyfiller.io going if you want if its on Hover.com currently and is $49.74 annually. I don't want any money for it just want to see it go to an appropriate home rather than being picked off and sat on by someone trying tomake money from it.

Add "context:[worker|window|node]"

If the context flag is given, we can filter out polyfills that isn't supported in that realm (unless the force modifier is given also)

Uint32Array Safari 9 El Capitain webpack console error

Using:

  • <script crossorigin="anonymous" src="https://polyfill.app/api/polyfill?features=es"></script>
  • Browserstack: OSX El Capitan, Safari 9.1

I get the following error:
image

Involved 🤷‍♂:

  • es.typed-array.uint32-array
  • es.typed-array.from

scroll-behavior not working on IOS' Safari

I'm using polyfiller to allow the use of scroll-behaviour and it work great on MacOS safari but on IOS it not doing anything not even scrolling

<script crossorigin src="https://polyfill.app/api/polyfill?minify&sourcemap&features=scroll-behavior"></script>

....

target.scrollIntoView({
  behavior: 'smooth'
})

Getting 500 status error

https://polyfill.app/api/polyfill?features=scroll-behavior

An Error occurred.
Code: 500

Value undefined out of range for undefined options property undefined

Default locale not set in Safari/Firefox for Intl polyfill

I was experimenting with the Intl polyfill API, and noticed a problem when running a RelativeTimeFormat command from MDN.

Loading "https://polyfill.app/api/polyfill?features=intl.relative-time-format|force,locales=en" into my page and then running var rtf1 = new Intl.RelativeTimeFormat('en', { style: 'narrow' });, I receive the error "ReferenceError: Could not determine locale: No default locale has been configured". This happens in both Safari and Firefox, but not Chrome.

Am I missing a step somewhere, or is the default locale not being added?

Chrome 86 error

Hey there,

Thanks for making Polyfiller!

I'm using the following URL to polyfill es, intl (Dutch) and fetch: https://polyfill.app/api/polyfill?features=es,intl|locale=nl,fetch
However, this returns an error when using Chrome 86:

An Error occurred.
Code: 500
BrowserslistError

BrowserslistError: Unknown version 86 of chrome at Function.select (/app/node_modules/browserslist/index.js:1086:17) at /app/node_modules/browserslist/index.js:336:33 at Array.reduce () at resolve (/app/node_modules/browserslist/index.js:318:18) at browserslist (/app/node_modules/browserslist/index.js:443:21) at normalizeBrowserslist (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:741:12) at generateBrowserslistFromUseragent (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:1461:36) at Object.userAgentSupportsFeatures (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:1501:35) at shouldIncludePolyfill (/app/dist/index.js:3456:102) at polyfillSet.forEach.polyfill (/app/dist/index.js:3491:13)

BrowserslistError: Unknown version 86 of chrome

Any idea what might be going on?

/api/polyfill doesn't work with Chrome Canary

When I open https://app.usebubbles.com the request to polyfill.app/api/polyfill does not return response, which makes the whole app stuck and waiting it. Can be reproduced in Chrome Canary 92.0.4473.0 canary (x86_64). Is not reproduced in stable version 89.0.4389.114 (x86_64)

curl 'https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es' \
  -H 'Connection: keep-alive' \
  -H 'Pragma: no-cache' \
  -H 'Cache-Control: no-cache' \
  -H 'sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"' \
  -H 'Origin: https://app.usebubbles.com' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4473.0 Safari/537.36' \
  -H 'Accept: */*' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: script' \
  -H 'Referer: https://app.usebubbles.com/' \
  -H 'Accept-Language: en-US,en;q=0.9,ru;q=0.8,uk;q=0.7' \
  --compressed

After timeout I see the following error in console:

Access to script at 'https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es' from origin 'https://app.usebubbles.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
app.usebubbles.com/:1 
GET https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es net::ERR_FAILED

Intl polyfill overrides Intl.Collator

I'm using Intl.Collator to compare some strings and also the Intl.ListFormat polyfill on the same app. My app fails while trying to create a instance of the Intl.Collator class.

Importing with the url: https://polyfill.app/api/polyfill?features=intl.list-format

Pen to reproduce: https://jsbin.com/peyulegiba/edit?html,js,output
(Opening in a browser that loads and applies the polyfill, yields undefined instead of function Collator())

When debugging on mobile Safari 12, i found the overriding line:

window.Intl = Intl$1;

Probably just coping over the Intl.Collator to the polyfilled Intl will solve the issue.

window.Intl = Object.assign(window.Intl, Intl$1);

Thanks for the awesome service, looking forward to use the custom-elements polyfill next. =D

Resize observer is not polyfilled in FBAN (Facebook) browser

User agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 LightSpeed [FBAN/MessengerLiteForiOS;FBAV/253.1.0.43.116;FBBV/200174216;FBDV/iPhone11,6;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBCR/;FBID/phone;FBLC/en_US;FBOP/0]

This is a version of the Safari browser on iOS. For some reason the resize observer is not polyfilled even with this script tag:

<script crossorigin src="https://polyfill.app/api/polyfill?features=es,fetch,pointer-event,scroll-behavior,resize-observer"></script>

Screen Shot 2020-02-27 at 4 17 34 PM

Screen Shot 2020-02-27 at 4 18 47 PM

Firefox 68 for Android does not polyfill pointer event

The "never worry about polyfills again" tagline is not true in this case, because a polyfill is clearly not being loaded.

I'm referring to the pointer-event feature.

It is not supported on Firefox for Android 68.

Yet when use Polyfiller like so:

<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior"></script>

The polyfill is not loaded. When I change it to:

<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event|force,scroll-behavior"></script>

It suddenly starts polyfilling and pointer events are detected.

Browser: https://whatsmybrowser.org/b/BY983

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.