Update #203236 youtube.com

This commit is contained in:
Adam Wróblewski
2025-09-23 08:08:47 +02:00
parent d49995c140
commit afeab685a7

View File

@@ -639,8 +639,7 @@ www.youtube.com#%#(()=>{const e={apply:(e,t,n)=>{if(location.href.includes("/sho
www.youtube.com#%#(()=>{const e={apply:(e,r,t)=>{if(location.href.includes("/shorts/"))return Reflect.apply(e,r,t);try{const a=t[0];if(!a?.context?.client)return Reflect.apply(e,r,t);a.context.client.clientScreen="ADUNIT",a.playbackContext&&(a.params=`yAEB${a.params?a.params:""}`),a.playerRequest&&(a.playerRequest.params=`yAEB${a.playerRequest.params?a.playerRequest.params:""}`),t[0]=a}catch(e){console.trace("Error occurred:",e)}return Reflect.apply(e,r,t)}};window.JSON.stringify=new Proxy(window.JSON.stringify,e)})();
! Fix ads on https://www.youtube.com/shorts/
! https://github.com/AdguardTeam/AdguardFilters/issues/172033#issuecomment-1991263854
! TODO: use scriptlet when this issue will be fixed - https://github.com/AdguardTeam/Scriptlets/issues/183
m.youtube.com,www.youtube.com#%#(()=>{window.JSON.parse=new Proxy(JSON.parse,{apply(r,e,t){const n=Reflect.apply(r,e,t);if(!location.pathname.startsWith("/shorts/"))return n;const a=n?.entries;return a&&Array.isArray(a)&&(n.entries=n.entries.filter((r=>{if(!r?.command?.reelWatchEndpoint?.adClientParams?.isAd)return r}))),n}});})();
youtube.com#%#//scriptlet('json-prune', 'entries.[-].command.reelWatchEndpoint.adClientParams.isAd')
! This one may be unnecessary:
||youtube.com/get_video_info?*=adunit&$important
! https://github.com/AdguardTeam/AdguardFilters/issues/81610