Upd youtube.com

This commit is contained in:
Adam Wróblewski
2024-06-09 14:59:22 +02:00
parent 8cc82c7700
commit 698b231861

View File

@@ -5,7 +5,7 @@
! Fix for new ads
! TODO: move to the Base filter if it doesn't break anything
||youtube.com^$replace=/"visitorData":".*?"\,//,document
youtube.com#%#//scriptlet('trusted-replace-node-text', 'script', 'ytplayer', '/"visitorData":".*?",/', '')
youtube.com#%#//scriptlet('set-constant', 'ytcfg.data_.INNERTUBE_CONTEXT.client.visitorData', 'undefined')
youtube.com#%#(()=>{const e={apply:(e,t,o)=>{if(!(window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id&&o[0]&&"X-Goog-Visitor-Id"===o[0]&&o[1]))return Reflect.apply(e,t,o)}};window.XMLHttpRequest.prototype.setRequestHeader=new Proxy(window.XMLHttpRequest.prototype.setRequestHeader,e)})();
youtube.com#%#(()=>{const t={construct:(t,e,o)=>{if(window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id){const t=e[0],o=e[1];if("https://www.youtube.com/"!==location.href&&t&&t.includes?.("/youtubei/"))try{delete o.headers["X-Goog-Visitor-Id"]}catch(t){console.trace(t)}if(o&&o.body?.includes("visitorData"))try{e[1].body=e[1].body.replace(/"visitorData":".*?",/,"")}catch(t){console.trace(t)}if(t&&t.includes?.("&sabr=1"))try{e[0]=e[0].replace("&sabr=1","")}catch(t){console.trace(t)}}return Reflect.construct(t,e,o)}};window.Request=new Proxy(window.Request,t)})();
! remove anti-adb