// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.youtube.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.fetch0 = window.fetch;
window.fetch = function (...args) {
return new Promise(function (a,b)
{
a()
}).then(function ()
{
return fetch0(...args);
}).then(function (u)
{
e = u;
return u.body.getReader().read();
}).then(function(a)
{
let r = new ReadableStream({
start(controller) {
controller.enqueue(a.value); //a.value verrà poi sostituito con la risposta modificata
controller.close();
}
}).pipeThrough(new TransformStream({
transform(chunk, controller) {
controller.enqueue(chunk);
}
}))
re = new Response(r,{status:e.status,statusText:e.statusText,headers:e.headers});
console.log(re);
return re;
})
}})()