polyfills

Web Components, HTML Imports polyfills not working in Firefox, IE

余生颓废 提交于 2020-01-04 15:29:10
问题 I am trying to get Web Components plus HTML Imports to work in Firefox and IE. I followed the instructions as per the Web Components GitHub repo, installed the files via npm, and included it towards the head of my document. I have a custom script that is called in the body of the document. In firefox, the polyfill is loaded dynamically (synchronously) but transforms the script tag in the body from: <script type="module" src="./src/scripts/init.js"></script> to <script src="/components

Object.prototype.__defineGetter__ (and __defineSetter__) polyfill

南楼画角 提交于 2020-01-04 06:23:12
问题 I know the __defineGetter__ (and __defineSetter__ ) method name is really weird and deprecated but I find it more convenient than Object.defineProperty . Compare yourself: //Readable Something.prototype.__defineGetter__("name", function() {return this._name;}); //Uh... - what? Object.defineProperty(Something.prototype, "name", { get: function() {return this._name;} }); Because, as I said, this method is being deprecated. So I'm creating a polyfill to put it back in bussiness: if(!Object

How do I make Angular 8 compatible with IE11?

别等时光非礼了梦想. 提交于 2019-12-30 06:37:29
问题 I upgraded to Angular 8 using ng update . It ran its migration scripts which (among other things) removed the es6/es7 imports in polyfills.ts . From what I read, Angular will create a special build for older browsers (including IE11) and I don't have to worry about polyfills anymore? I updated browserlist to be not IE 9-10 instead of not IE 9-11 to (I presume) hint that it should build the appropriate polyfills. Unfortunately, after running ng build , I get some polyfill related errors, eg.

CSS3 animation-fill-mode polyfill

99封情书 提交于 2019-12-30 04:04:09
问题 Preface Let's pretend that a div is animated from opacity:0; to opacity:1; and i want to keep opacity:1; after the animation ends. That's what animation-fill-mode:forwards; does. @keyframes myAnimation { from { opacity:0; } to { opacity:1; } } div { opacity:0; animation-name:myAnimation; animation-delay:1s; animation-duration:2s; animation-fill-mode:forwards; }​ <div>just a test</div>​ Run it on jsFiddle Note 1: i didn't include the vendor prefixes here to simplify Note 2: that's just an

JSON polyfill: JSON 2 or JSON 3?

拜拜、爱过 提交于 2019-12-29 05:05:27
问题 I need a JSON polyfill to support IE 7 and some IE 8 and IE 9 modes. Should I pick JSON 2 or JSON 3? Obviously JSON 3 is a more modern implementation, but for example a site like html5please doesn't even mention it and recommends JSON 2. 回答1: HTML5 Please has updated their JSON page to include JSON 3 as the main polyfill for use, with JSON 2 taking a backseat as the older replacement. 回答2: I was wondering the same thing. JSON3 says: Changes from JSON 2 JSON 3... Correctly serializes primitive

How to add a polyfill to support finally() in Edge?

余生长醉 提交于 2019-12-29 01:34:29
问题 I'm using axios library and using then(), catch() and finally(). Works perfectly in Chrome. However the finally() method does not work in MS Edge. I researched using polyfills or shims and I'm lost. I am not using webpack or transpiling and don't plan to add them. I need to keep this simple. How can I add a polyfill to make sure finally() works in Edge? Thanks! 回答1: This should handle the propagation of the thenable's species in addition to the behaviors detailed below: Promise.prototype

Webcomponents.js issue on IE and Firefox

爷,独闯天下 提交于 2019-12-25 08:21:37
问题 I try to make a simple web component. For browser compatibility, I use the NPM package webcomponents.js (version 0.7.23). I run my little code with Polyserve. My code is on Github: https://github.com/olofweb/Webcomponents On Chrome (version 55) -> ok On IE (version 11) -> ko On Firefox (version 50.1) -> ko Error: https://github.com/olofweb/Webcomponents/blob/master/hello-world.html#L31 IE 11 (sorry, I don't have the english error) : "L'objet ne gère pas la propriété ou la méthode

Add PolyFill.js in AngularJS application

Deadly 提交于 2019-12-24 23:33:15
问题 WE are embedding PowerBi JavaScript SDK in angularJs App. PowerBI Javascript SDK makes use of the Promise. IE 11 do not support Promises. Lot of posts directed me to make use of ployfill.js for the same. My Question is how do I Inject PolyFill.js file in angularjs app? 回答1: If you are using Webpack for bundling, add the polyfill.js before your main entry script. module.exports = { entry: ['polyfill.js', './main.js'] }; If you are using script tags in html, make sure to include the script

Using Javascript to dynamically add styles to stylesheet but I get a “Cannot read property 'length' of undefined” error

余生颓废 提交于 2019-12-24 12:10:03
问题 I am currently trying to make my own polyfill that will allow older browsers such as Internet Explorer the ability to read and execute media queries using traditional css selectors. The process flow goes something like this: Iterate through each stylesheet found within document Run through each style rule in stylesheet searching for media queries Define what device size we are targeting then apply appropriate "id" Dynamically add css line with selector to existing stylesheet The idea is that

How to Polyfill Promise in Visual Studio 2017 Office Add-in TypeScript Project

非 Y 不嫁゛ 提交于 2019-12-24 11:37:18
问题 I am using TypeScript in an Office Add-in, and I want to use async / await functions specifically. The project fails to compile with "TS2468 TypeScript Cannot find global value 'Promise'." I have read on here that I have to create a polyfill for Promise, but so far have not been able to figure out how to get a polyfill working in Visual Studio 2017. I am attempting to use core-js, and have installed it in to the project using npm install core-js. I can see core-js is installed under node