Add SPV Safari 16 toArray fix userscript

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
StyxX65andClaude Opus 5.5 committed 2026-09-28 13:41:31 +02:00
commit eb9aa78c07
2 files changed
+23

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
// ==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
});
})();