polyfill DOM enumerables for Chrome 49

This commit is contained in:
tophf 2017-04-08 13:19:44 +03:00
parent 1ded89969b
commit ff84e924fa
5 changed files with 11 additions and 3 deletions

7
dom.js
View File

@ -4,6 +4,13 @@ if (!/Windows/i.test(navigator.userAgent)) {
document.documentElement.classList.add('non-windows');
}
// polyfill for old browsers to enable [...results] and for-of
for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection]) {
if (!type.prototype[Symbol.iterator]) {
type.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
}
}
function onDOMready() {
if (document.readyState != 'loading') {

View File

@ -644,6 +644,7 @@
<a target="_blank" href="https://github.com/stylish-userstyles/stylish/wiki/Applying-styles-to-specific-sites#advanced-matching-with-regular-expressions"><svg class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></a>
</template>
<script src="dom.js"></script>
<script src="storage.js"></script>
<script src="messaging.js"></script>
<script src="localization.js"></script>

View File

@ -115,11 +115,11 @@
<span class="expander">...</span>
</template>
<script src="dom.js"></script>
<script src="health.js"></script>
<script src="storage.js"></script>
<script src="messaging.js"></script>
<script src="apply.js"></script>
<script src="dom.js"></script>
<script src="localization.js"></script>
<script src="manage.js"></script>
</head>

View File

@ -3,11 +3,11 @@
<head>
<title>Stylus Options</title>
<link rel="stylesheet" href="index.css">
<script src="/dom.js"></script>
<script src="/localization.js"></script>
<script src="/apply.js"></script>
<script src="/storage.js"></script>
<script src="/messaging.js"></script>
<script src="/dom.js"></script>
</head>
<body>

View File

@ -55,12 +55,12 @@
</div>
</template>
<script src="dom.js"></script>
<script src="localization.js"></script>
<script src="health.js"></script>
<script src="storage.js"></script>
<script src="messaging.js"></script>
<script src="apply.js"></script>
<script src="dom.js"></script>
<script src="popup.js"></script>
</head>