Runer112

uBlock Twitch ad block

Sep 29th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  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. })();
Add Comment
Please, Sign In to add comment