Facebook
From Insensitive Cockroach, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 136
  1. # https://github.com/uBlockOrigin/uAssets/pull/3517
  2. twitch-videoad.js application/javascript
  3. (function() {
  4.         if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
  5.         var realFetch = window.fetch;
  6.         window.fetch = function(input, init) {
  7.                 if ( arguments.length >= 2 && typeof input === 'string' && input.includes('/access_token') ) {
  8.                         var url = new URL(arguments[0]);
  9.                         url.searchParams.forEach(function(value, key) {
  10.                             url.searchParams.delete(key);
  11.                         });
  12.                         arguments[0] = url.href;
  13.                 }
  14.                 return realFetch.apply(this, arguments);
  15.         };
  16. })();