Skip to content

Instantly share code, notes, and snippets.

@JakeCoxon
Created September 30, 2020 12:02
Show Gist options
  • Save JakeCoxon/bb319c5cc82f38bf29e502c3b2f30fa7 to your computer and use it in GitHub Desktop.
Save JakeCoxon/bb319c5cc82f38bf29e502c3b2f30fa7 to your computer and use it in GitHub Desktop.
# https://github.com/uBlockOrigin/uAssets/pull/3517
twitch-videoad.js application/javascript
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
var realFetch = window.fetch;
window.fetch = function(input, init) {
if ( arguments.length >= 2 && typeof input === 'string' && input.includes('/access_token') ) {
var url = new URL(arguments[0]);
url.searchParams.forEach(function(value, key) {
url.searchParams.delete(key);
});
arguments[0] = url.href;
}
return realFetch.apply(this, arguments);
};
})();
// from https://gist.githubusercontent.com/pixeltris/e78bb8f9d8a7a22665958e339b2d45dd/raw/twitch2.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment