Jump to content

NotHereToPlayGames

Member
  • Posts

    6,714
  • Joined

  • Last visited

  • Days Won

    83
  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by NotHereToPlayGames

  1. You seem to be missing: 1) .toReversed 2) .toSpliced 3) .with The previous post "all-in-one" should cover all four. But these three as individual polyfills are below, in case you want them. // ==UserScript== // @name Inject Change Array by Copy .toReversed() Polyfill [110] // @version 0.0.1 // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== if (!Array.prototype.toReversed) { Array.prototype.toReversed = function () { return this.slice().reverse(); }; } // ==UserScript== // @name Inject Change Array by Copy .toSpliced() Polyfill [110] // @version 0.0.1 // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== if (!Array.prototype.toSpliced) { Array.prototype.toSpliced = function (start, deleteCount, ...items) { const copy = this.slice(); copy.splice(start, deleteCount, ...items); return copy; }; } // ==UserScript== // @name Inject Change Array by Copy .with() Polyfill [110] // @version 0.0.1 // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== if (!Array.prototype.with) { Array.prototype.with = function (index, value) { const copy = this.slice(); copy[index] = value; return copy; }; }
  2. I'd start with all-of-the-below then watch the Javascript Console (Ctrl-Shift-J) for items in red to provide hints for where to go from there. // ==UserScript== // @name Inject Change Array by Copy All-in-One Polyfill [110] // @version 0.0.1 // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== ((arrayPrototype, typedArrayPrototype) => { "use strict"; const typedArrayLength = Function.call.bind( Object.getOwnPropertyDescriptor(typedArrayPrototype, "length").get ); function toIntegerOrInfinity(arg) { let n = Number(arg); if (Number.isNaN(n) || n === 0) { return 0; } if (n === Number.POSITIVE_INFINITY) { return Number.POSITIVE_INFINITY; } if (n === Number.NEGATIVE_INFINITY) { return Number.NEGATIVE_INFINITY; } let i = Math.floor(Math.abs(n)); if (n < 0) { i = -i; } return i; } function toObject(val) { if (val === null || val === undefined) { throw new TypeError(`${val} is not an object`); } return Object(val); } function lengthOfArrayLike(arr) { if (!(typeof arr === "object" && arr !== null)) { throw new TypeError(); } let len = toIntegerOrInfinity(arr["length"]); if (!Number.isFinite(len)) { len = 0; } return Math.max(0, Math.min(len, Number.MAX_SAFE_INTEGER)); } /** @typedef {Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|BigInt64Array|BigUint64Array} TypedArray */ /** * @param {unknown} v * @returns {TypedArray} */ function assertTypedArray(v) { typedArrayPrototype.keys.call(v); // @ts-expect-error return v; } /** * @param {TypedArray} arr * @returns {TypedArray[typeof Symbol.toStringTag]} */ function typedArrayNameInternalSlot(arr) { return Object.getOwnPropertyDescriptor(typedArrayPrototype, Symbol.toStringTag) .get.call(arr); } /** * @param {TypedArray} example * @param {number} length * @returns {TypedArray} */ function typedArrayCreate(example, length) { assertTypedArray(example); const arrayName = typedArrayNameInternalSlot(example); switch (arrayName) { case 'Int8Array': return new Int8Array(length); case 'Uint8Array': return new Uint8Array(length); case 'Uint8ClampedArray': return new Uint8ClampedArray(length); case 'Int16Array': return new Int16Array(length); case 'Uint16Array': return new Uint16Array(length); case 'Int32Array': return new Int32Array(length); case 'Uint32Array': return new Uint32Array(length); case 'Float32Array': return new Float32Array(length); case 'Float64Array': return new Float64Array(length); case 'BigInt64Array': return new BigInt64Array(length); case 'BigUint64Array': return new BigUint64Array(length); default: /** @type {never} */ const n = arrayName; throw new Error(`Unexpected TypedArray name ${n}`); } } /** * @param {TypedArray} example * @returns {boolean} */ function isBigIntArray(example) { assertTypedArray(example); const arrayName = typedArrayNameInternalSlot(example); switch (arrayName) { case 'BigInt64Array': case 'BigUint64Array': return true; } return false; } function transfer({ count, src, srcStart, srcStep = 1, target, targetStart, targetStep = srcStep }) { let from = srcStart; let to = targetStart; for (let i = 0; i < count; i++) { target[to] = src[from]; from += srcStep; to += targetStep; } } /** * @param {TypedArray} example * @param {unknown} value * @description convert `value` to bigint or number based on the the type of array * @returns {bigint | number} * @throws if one of the override methods throws. e.g. `@@toPrimitive`, `valueOf`, `toString` */ function typedArrayNumberConversion(example, value) { let asNumber; { if (isBigIntArray(example)) { asNumber = 0n; } else { asNumber = -0; // important to use `-0` and not `0` } // @ts-ignore : using `+=` to emulate ToBigInt or ToNumber asNumber += value; } return asNumber; } defineArrayMethods({ toReversed() { const o = toObject(this); const len = lengthOfArrayLike(o); const a = new Array(len); transfer({ src: o, srcStart: len - 1, srcStep: -1, target: a, targetStart: 0, targetStep: 1, count: len }); return a; }, }); defineTypedArrayMethods({ toReversed() { const o = assertTypedArray(this); const len = typedArrayLength(o); const a = typedArrayCreate(o, len); transfer({ src: o, srcStart: len - 1, srcStep: -1, target: a, targetStart: 0, targetStep: 1, count: len }); return a; }, }); defineArrayMethods({ toSorted(compareFn) { if (compareFn !== void 0 && typeof compareFn !== "function") { throw new TypeError(); } const o = toObject(this); const len = lengthOfArrayLike(o); const a = new Array(len);; transfer({ src: o, srcStart: 0, target: a, targetStart: 0, count: len }); arrayPrototype.sort.call(a, compareFn); return a; }, }); defineTypedArrayMethods({ toSorted(compareFn) { if (compareFn !== void 0 && typeof compareFn !== "function") { throw new TypeError(); } const o = assertTypedArray(this); const len = typedArrayLength(o); const a = typedArrayCreate(o, len); transfer({ src: o, srcStart: 0, target: a, targetStart: 0, count: len }); typedArrayPrototype.sort.call(a, compareFn); return a; }, }); function calculateSplice({ start, len, deleteCount, values, argsCount }) { const relativeStart = toIntegerOrInfinity(start); let actualStart; if (relativeStart === -Infinity) { actualStart = 0; } else if (relativeStart < 0) { actualStart = Math.max(len + relativeStart, 0); } else { actualStart = Math.min(relativeStart, len); } const insertCount = values.length; let actualDeleteCount; if (/* start is not present */ argsCount === 0) { actualDeleteCount = 0; } else if (/* deleteCount is not present */ argsCount === 1) { actualDeleteCount = len - actualStart; } else { const dc = toIntegerOrInfinity(deleteCount); actualDeleteCount = Math.max(0, Math.min(dc, len - actualStart)); } const newLen = len + insertCount - actualDeleteCount; return { actualStart, newLen, actualDeleteCount }; } function doSplice({ src, target, actualStart, actualDeleteCount, values, newLen }) { let i = 0; while (i < actualStart) { target = src; i++; } for (const E of values) { target = E; i++; } let r = actualStart + actualDeleteCount; while (i < newLen) { let fromValue = src[r]; target = fromValue; i++; r++; } } defineArrayMethods({ toSpliced(start, deleteCount, ...values) { const o = toObject(this); const len = lengthOfArrayLike(o); const { actualStart, actualDeleteCount, newLen } = calculateSplice({ start, deleteCount, len, values, argsCount: arguments.length }); if (newLen > Number.MAX_SAFE_INTEGER) { throw new TypeError(); } const a = new Array(newLen); doSplice({ src: o, target: a, actualStart, actualDeleteCount, values, newLen }); return a; } }); defineArrayMethods({ with(index, value) { const o = toObject(this); const len = lengthOfArrayLike(o); const relativeIndex = toIntegerOrInfinity(index); const actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; if (actualIndex < 0 || actualIndex >= len) { throw new RangeError(); } const a = new Array(len); for (let k = 0; k < len; k++) { const v = k === actualIndex ? value : o[k]; a[k] = v; } return a; } }); defineTypedArrayMethods({ with(index, value) { const o = assertTypedArray(this); const len = typedArrayLength(o); const relativeIndex = toIntegerOrInfinity(index); const actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; const asNumber = typedArrayNumberConversion(o, value); if (actualIndex < 0 || actualIndex >= len) { throw new RangeError(); } const a = typedArrayCreate(o, len); for (let k = 0; k < len; k++) { const v = k === actualIndex ? asNumber : o[k]; a[k] = v; } return a; } }); /** @type {(def: { [N in "with" | "toReversed" | "toSorted" | "toSpliced"]?: typeof Array.prototype[N] }) => void} */ function defineArrayMethods(def) { defineMethods(arrayPrototype, def).forEach(name => { if (name !== 'with') { // 'with' is already a keyword arrayPrototype[Symbol.unscopables][name] = true; } }); } /** @type {(def: { [N in "with" | "toReversed" | "toSorted"]?: (this: TypedArray, ...args: Parameters<Uint8Array[N]>) => TypedArray }) => void} */ function defineTypedArrayMethods(def) { defineMethods(typedArrayPrototype, def); } function defineMethods(obj, def) { return Object.entries(def).map(([name, method]) => { Object.defineProperty(obj, name, { value: method, enumerable: false, configurable: true, writable: true, }); return name; }); } })(Array.prototype, Object.getPrototypeOf(Int8Array.prototype)); // ==UserScript== // @name Inject Promise.withResolvers() Polyfill [119] // @version 0.0.1 // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== Promise.withResolvers || (Promise.withResolvers = function withResolvers() { var a, b, c = new this(function (resolve, reject) { a = resolve; b = reject; }); return {resolve: a, reject: b, promise: c}; }); // ==UserScript== // @name Inject structuredClone() [major] Polyfill [98] // @version 0.0.1 // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== 'use strict'; const VOID = -1; const PRIMITIVE = 0; const ARRAY = 1; const OBJECT = 2; const DATE = 3; const REGEXP = 4; const MAP = 5; const SET = 6; const ERROR = 7; const BIGINT = 8; // const SYMBOL = 9; const EMPTY = ''; const {toString} = {}; const {keys} = Object; const typeOf = value => { const type = typeof value; if (type !== 'object' || !value) return [PRIMITIVE, type]; const asString = toString.call(value).slice(8, -1); switch (asString) { case 'Array': return [ARRAY, EMPTY]; case 'Object': return [OBJECT, EMPTY]; case 'Date': return [DATE, EMPTY]; case 'RegExp': return [REGEXP, EMPTY]; case 'Map': return [MAP, EMPTY]; case 'Set': return [SET, EMPTY]; } if (asString.includes('Array')) return [ARRAY, asString]; if (asString.includes('Error')) return [ERROR, asString]; return [OBJECT, asString]; }; const shouldSkip = ([TYPE, type]) => ( TYPE === PRIMITIVE && (type === 'function' || type === 'symbol') ); const serializer = (strict, json, $, _) => { const as = (out, value) => { const index = _.push(out) - 1; $.set(value, index); return index; }; const pair = value => { if ($.has(value)) return $.get(value); let [TYPE, type] = typeOf(value); switch (TYPE) { case PRIMITIVE: { let entry = value; switch (type) { case 'bigint': TYPE = BIGINT; entry = value.toString(); break; case 'function': case 'symbol': if (strict) throw new TypeError('unable to serialize ' + type); entry = null; break; case 'undefined': return as([VOID], value); } return as([TYPE, entry], value); } case ARRAY: { if (type) return as([type, [...value]], value); const arr = []; const index = as([TYPE, arr], value); for (const entry of value) arr.push(pair(entry)); return index; } case OBJECT: { if (type) { switch (type) { case 'BigInt': return as([type, value.toString()], value); case 'Boolean': case 'Number': case 'String': return as([type, value.valueOf()], value); } } if (json && ('toJSON' in value)) return pair(value.toJSON()); const entries = []; const index = as([TYPE, entries], value); for (const key of keys(value)) { if (strict || !shouldSkip(typeOf(value[key]))) entries.push([pair(key), pair(value[key])]); } return index; } case DATE: return as([TYPE, value.toISOString()], value); case REGEXP: { const {source, flags} = value; return as([TYPE, {source, flags}], value); } case MAP: { const entries = []; const index = as([TYPE, entries], value); for (const [key, entry] of value) { if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) entries.push([pair(key), pair(entry)]); } return index; } case SET: { const entries = []; const index = as([TYPE, entries], value); for (const entry of value) { if (strict || !shouldSkip(typeOf(entry))) entries.push(pair(entry)); } return index; } } const {message} = value; return as([TYPE, {name: type, message}], value); }; return pair; }; /** * @typedef {Array<string,any>} Record a type representation */ /** * Returns an array of serialized Records. * @param {any} value a serializable value. * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that, * if `true`, will not throw errors on incompatible types, and behave more * like JSON stringify would behave. Symbol and Function will be discarded. * @returns {Record[]} */ const serialize = (value, {json, lossy} = {}) => { const _ = []; return serializer(!(json || lossy), !!json, new Map, _)(value), _; }; const env = typeof self === 'object' ? self : globalThis; const deserializer = ($, _) => { const as = (out, index) => { $.set(index, out); return out; }; const unpair = index => { if ($.has(index)) return $.get(index); const [type, value] = _[index]; switch (type) { case PRIMITIVE: case VOID: return as(value, index); case ARRAY: { const arr = as([], index); for (const index of value) arr.push(unpair(index)); return arr; } case OBJECT: { const object = as({}, index); for (const [key, index] of value) object[unpair(key)] = unpair(index); return object; } case DATE: return as(new Date(value), index); case REGEXP: { const {source, flags} = value; return as(new RegExp(source, flags), index); } case MAP: { const map = as(new Map, index); for (const [key, index] of value) map.set(unpair(key), unpair(index)); return map; } case SET: { const set = as(new Set, index); for (const index of value) set.add(unpair(index)); return set; } case ERROR: { const {name, message} = value; return as(new env[name](message), index); } case BIGINT: return as(BigInt(value), index); case 'BigInt': return as(Object(BigInt(value)), index); } return as(new env[type](value), index); }; return unpair; }; /** * @typedef {Array<string,any>} Record a type representation */ /** * Returns a deserialized value from a serialized array of Records. * @param {Record[]} serialized a previously serialized value. * @returns {any} */ const deserialize = serialized => deserializer(new Map, serialized)(0); if (!("structuredClone" in env)) env.structuredClone = (any, options) => deserialize(serialize(any, options));
  3. Agreed! But that doesn't mean America is the "only" country with this hallmark. Moving on... "Toodles"...
  4. Any luck? I do not have a Discord account so cannot 'Add Friend'. I'm always curious of growing lists of needed polyfills.
  5. <OT reply to OT which was in turn a reply to an OT instigated by an OT> That's the FUNNY part! People like to boast how "privacy-conscious" they are. But then they will jump through hoops to be "fingerprinted" to gain access to such websites. You may already have, without knowing it. Not to the extent of my "exaggeration-for-effect" scenario, of course. Germany has an extremly high crime rate, I have no doubt that Germans are "protecting what they own". https://www.dw.com/en/germany-violent-crime-reaches-15-year-high-report/a-68758122 https://worldpopulationreview.com/country-rankings/crime-rate-by-country
  6. True! But whether we like it or not, what the website owner is protecting belongs to them as the owner and not to us as the user. No different than Homeowner A leaving the door unlocked 24/7 because the "odds" of somebody turning the doorknob to even check is "low". Versus Homeowner B with the door locked, two deadbolts, a sliding chain, and a shotgun aimed at the entrance with the trigger pulled by a string from anywhere in the house. edit - ie, owners are allowed to protect what they own
  7. Dig deeper. Windows 2000 "collected basic system information for diagnostic and security purposes". By definition, that "collection" is a form of 'spying' (by today's standards if not by then-standards).
  8. Apple's success has relatively little to do with the Macbook. Apple owes its success to the iPhone. So much so (mobile over desktop) that Microsoft's Win8.1 and Win11 are both basically Microsoft's attempt to catch up with Apple. The whole ideology behind the "start bar" being centered is, to me at least, nothing but a PHONE'S way of doing things migrating to the DESKTOP. Centering the "start bar" just makes a desktop "look like" a phone. But maybe that's just me, lol.
  9. Ok, last "OT" (stop beating the dead horse already, I am aware it is "OT") [lol, nobody actually started beating the dead horse, I can PREDICT the future and I can SEE it on the horizon, lol]. Turns out the issue IS indeed with ungoogled-chromium and has been fixed in v133 with an opt-in resolution planned for v134+. It's actually a WEBGL issue in ungoogled coupled with H264ify. Despite being "OT", I leave this all here for readers to acquire some knowledge.
  10. To bring it back "OT" -- how do I improve AUDIO QUALITY and HARDWARE ACCELERATION in Moz-based browsers? Video quality in Moz-based seems to be "better" than Chrome-based. But only on my primary monitor. Move the video to a secondary monitor and fast-paced motion scenes lag BIG TIME. Audio quality also suffers BIG TIME. Sounds "muffled" compared to Chrome-based. Moz-based sounds like a 64 kilobits per second bitrate where Chrome-based sounds like a 256 kilobits per second bitrate.
  11. I have not tested if this is only an Ungoogled Chromium issue. I suppose that is very possible. I don't really have any "need" for non-ungoogled here at home and I am "forced" to use "real" Chrome at work (YouTube works at work). edit - per https://github.com/ungoogled-software/ungoogled-chromium/issues/3204 , this does seem to be an Ungoogled issue (which only really confirms YouTube/Google "telemetry" and only browsers that "allow" such telemetry can use YouTube).
  12. It is not a configuration issue. I have already ruled that out. It's also not an adblocker issue, running "na ked" and using a "vir gin" default Chrome (v131) profile also has buffer issues. YouTube works FINE, with or without Vorapis, in anything NON-CHROME (ie, New Moon, Mypal, Serpent, Pale Moon, IceCat). It is only in Chrome. YEAH, I know!, it is technically "OT" for this thread! But this thread is where the Vorapis was discussed, I was too lazy to start a new thread.
  13. Not sure why we are so harsh on Windows / Microsoft. How is Facebook/Meta, Google, Amazon, Disney, Instagram, Snapchat, TikTok, AT&T any different? -- that would be my telemetry versus privacy rights list. My profits versus people list would be -- Facebook, the NFL, Electronic Arts, University of Phoenix, Uber, Comcast, Oracle, Western Digital, Seagate, Apple, McDonald's, Coca-Cola.
  14. Disregard! That was short-lived! Videos are consistently stopping about three and half minutes in then the infamous swirling circle indicating buffering rears its ugly head! IceCat remains fine - without VORAPIS.
  15. I've (finally) become a VORAPIS user. YouTube has always ran fine for me (with uBO adblocking + Stylus userstyles + Tampermonkey userscripts). But for the last week or so, YouTube has become a NIGHTMARE. Buffering issues galore. But only in Chrome and only at home, work with same browser profile has remained fine). IceCat here at home remains fine. VORAPIS to the rescue! I'm not liking how VORAPIS has to refresh the ENTIRE page when it goes from one playlist item to the next. But a small price to pay to avoid the d#mn buffering issues.
  16. I should also add that when I first trial-ran "arkenfox" several months ago, I did not do so in a brand-new fresh-and-clean profile. I have since revisited and without arkenfox, IceCat (v115 ESR) Speedometer 3.0 scores range from 5.06 to 5.10. With arkenfox, my scores range from 6.00 to 6.17. I'll cite that as a significant improvement. And while IceCat does not yet have a v128 ESR branch (I patiently await), the v115 scores are HALF that which I get in an Ungoogled Chromium Fork (Huiaei v131) which range from 12.3 to 12.6. Before finding the Huiaei fork, my Official Ungoogled v122 only scored 9.3 to 9.7.
  17. I still kind of find your benchmark scores "confusing". ie, they don't seem, to me at least, to "agree" with majority of publicly shared scores. By that, I do specifically refer to your ability, in the past at least, to score higher scores in Firefox than Edge. Your most recent post does report what I would expect - a higher score in Edge than in Firefox. I cite that as a newfound Big Fan of IceCat - but I cannot for the life of me to get it to score anywhere near as good as Chrome/Chromium forks - NOWHERE NEAR. I found this site interesting as far as benchmark historical trends - Source Link - https://arewefastyet.com/win11/benchmarks/raptor-desktop-speedometer3?numDays=365 You can even see some "bump-ups" in the historical trend. Early Nov 2024 bump-up for Firefox would be right around v132 and v133. So tests from v131 through v134 would prove interesting. There's another Firefox slight bump-up in mid Feb 2025. Would be right around v135. So perhaps directly comparing v130 to v135 would also prove quite interesting. Chrome's July 2024 bump would be approx v127. Chrome's Nov 2024 bump would be approx v130. Chrome's Feb 2025 bump would be approx v132/v133.
  18. My bad. I saw the file name "VxKex" and that threw me.
  19. Don't blame me, blame the author for claiming that it does.
  20. AGREED! Trip cited that only ONE cert is expiring. That is easy to track down, easy to export from a newer Firefox, easy to import to preferred-older. Moving on... "Toodles"...
  21. D.Draker - there is no need to be so... no adjective is going to be typed! I offered a solution that I have used in the past, one that works, one that may POSSIBLY be considered "over-complicated", Trip can use the info or disregard it, no skin off my back either way.
  22. I did not know that there is a "cert folder". I provided a solution that I know works as I've had to implement it in the past (on Pale Moon, not on Firefox, but they are identical for the sake of this discussion). Over-complicated? Perhaps, especially if it is indeed as easy as copying a "cert folder". Speaking solely for myself, I would *NOT* want to copy an entire cert database from "new to old", I would only copy (export from new, import to old) ONE CERT at a time, not "all at once". My thinking though is from the XP Days. There are certs that work in Win7+ that do not work in XP. So why import them into XP?
  23. Track down "which" certificate is expiring. Export that certificate from a newer version of Firefox running in a VM. Import the certificate to the version of Firefox that you want to keep.
  24. Here ( link ) is a v127 that is supposed to work on Vista with the extended kernel. I do not run Vista or extended kernels but I have ran this browser in Win10. In fact, it actually dethroned my Official Ungoogled v122 on Win10 because it scores higher on "not everybody trusts" benchmark scores. On my system, Official Ungoogled v122 scores 156 thru 162, this v127 scores 204 thru 211 [Speedometer 2.1]. I've since found an even better ungoogled fork v131 ( link ) [scores 208 thru 214, basically within margin of error but is a "newer" engine] but that one is "OT" for this thread, just citing for reference.
×
×
  • Create New...