Files
spv-fix/spv-fix.user.js
T
2026-09-28 13:41:31 +02:00

16 lines
567 B
JavaScript

// ==UserScript==
// @name SPV Safari 16 fix
// @description Adds Iterator.prototype.toArray missing in Safari < 18.4 (Sprogvurdering)
// @match https://*.sprogvurdering.dk/*
// @run-at document-start
// @inject-into page
// @version 1.0
// ==/UserScript==
(() => {
const P = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
if (!P.toArray) Object.defineProperty(P, 'toArray', {
value: function () { const a = []; for (const x of this) a.push(x); return a; },
writable: true, configurable: true
});
})();