@honeo/web-api-polyfill
v1.1.0
Published
WebAPIのPolyfill詰め合わせ
Downloads
7
Readme
web-api-polyfill
なにこれ
自分で使うWebAPIのPolyfill詰め合わせ。
使い方
Babelを通すとコケるかもしれない。
$ npm i @honeo/web-api-polyfill
require('@honeo/web-api-polyfill');
参考
使ってるやつ
自前
document.head
~~Element.prototype.matches~~ => dom4
location.origin
HTMLCollection, NodeListをIterableに。
BroadcastChannel
CSS.supports
DOMParser
EventTarget
fetch
dom4
DOM Lv.4その他。
不具合
Firefox拡張機能のContentsScript内コンテキストではパーミッションエラーが出て動作しない。
ParentNode
ParentNode.prepend(), ParentNode.appnd(), ParentNode.query(), ParentNode.queryAll()
ChildNode
ChildNode.before(), ChildNode.after(), ChildNode.replaceWith(), ChildNode.remove()
Element
Element#classList, Element#matches(), Element#closest()
Event
add,removeEventListener(,,object)
Other
~~requestAnimationFrame()~~ => requestAnimationFrame polyfill
ChildNode
- ~~JAK/childNode.js at master · seznam/JAK~~ => dom4
classList
- ~~eligrey/classList.js~~ => dom4
requestAnimationFrame
- requestAnimationFrame polyfill
- setTimeout実装、dom4内蔵のものはレガシー環境で止まりやすいため。
performance.now()
URL
Web Animations API
不具合
- Firefox v~57
- SDK, WebExtensionsともに、拡張機能のContentsScript内コンテキストではパーミッションエラーが出て動作しない。
- Safari
- Safari v5.1.7とPolyfill v2.2.2で[TypeError: setting a property that has only a getter]が発生する。
- Polyfill v2.2.1に固定中。