Add SPV Safari 16 toArray fix userscript
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
eb9aa78c07
2 files changed
+23
No files matched your search
@@ -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
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user