Skip to content

Instantly share code, notes, and snippets.

@velzie
Created August 4, 2024 23:46
Show Gist options
  • Save velzie/27495dd1ee23cedd76e56bfaf8722c59 to your computer and use it in GitHub Desktop.
Save velzie/27495dd1ee23cedd76e56bfaf8722c59 to your computer and use it in GitHub Desktop.
fix youtube errors on non google chrome browsers
// ==UserScript==
// @name fix google breaking youtube on certain browsers
// @run-at document-start
// @version 2024-08-04
// @description fuck google
// @author velzie
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
// service worker is rigged to crash navigation after a while, haven't debugged this any further
navigator.__defineGetter__("serviceWorker",()=>{});
// if adblocker is detected google tries to spam requests to lag out ublock
navigator.sendBeacon = ()=>true;
XMLHttpRequest.prototype.open = new Proxy(XMLHttpRequest.prototype.open, {
apply(fn, that, args) {
if (args[1].includes("log_event") || args[1].includes("hasfast")) return;
return Reflect.apply(fn, that, args);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment