mirror of
https://github.com/AdguardTeam/AdguardFilters.git
synced 2026-08-29 12:14:41 +00:00
Upd youtube.com
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
! Fix for new ads
|
||||
! TODO: move to the Base filter if it doesn't break anything
|
||||
youtube.com#%#//scriptlet('adjust-setTimeout', '[native code]', '17000', '0.001')
|
||||
youtube.com#%#(()=>{let t=document.location.href,e=[],n=[],o=!1;const r=Array.prototype.push,i={apply:(t,i,l)=>(window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id&&l[0]&&l[0]!==window&&"number"==typeof l[0].start&&l[0].end&&"ssap"===l[0].namespace&&l[0].id&&(o||0!==l[0]?.start||n.includes(l[0].id)||(e.length=0,n.length=0,o=!0,r.call(e,l[0]),r.call(n,l[0].id)),o&&0!==l[0]?.start&&!n.includes(l[0].id)&&(r.call(e,l[0]),r.call(n,l[0].id))),Reflect.apply(t,i,l))};window.Array.prototype.push=new Proxy(window.Array.prototype.push,i),AG_onLoad((function(){if(!window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id)return;const r=()=>{const t=document.querySelector("video");if(t&&e.length){const r=Math.round(t.duration),i=Math.round(e.at(-1).end/1e3);if(0===t.currentTime&&r&&r===i){const r=Math.ceil(e.at(-1).start/1e3);t.currentTime<r&&(t.currentTime=r,o=!1,e.length=0,n.length=0,skippedAdUrl=document.location.href)}}};r();new MutationObserver((()=>{t!==document.location.href?(t=document.location.href,e.length=0,n.length=0,o=!1,r()):r()})).observe(document,{childList:!0,subtree:!0})}))})();
|
||||
youtube.com#%#(()=>{let t=document.location.href,e=[],n=[],o=!1;const r=Array.prototype.push,i={apply:(t,i,a)=>(window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id&&a[0]&&a[0]!==window&&"number"==typeof a[0].start&&a[0].end&&"ssap"===a[0].namespace&&a[0].id&&(o||0!==a[0]?.start||n.includes(a[0].id)||(e.length=0,n.length=0,o=!0,r.call(e,a[0]),r.call(n,a[0].id)),o&&0!==a[0]?.start&&!n.includes(a[0].id)&&(r.call(e,a[0]),r.call(n,a[0].id))),Reflect.apply(t,i,a))};window.Array.prototype.push=new Proxy(window.Array.prototype.push,i),AG_onLoad((function(){if(!window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id)return;const r=()=>{const t=document.querySelector("video");if(t&&e.length){const r=Math.round(t.duration),i=Math.round(e.at(-1).end/1e3);if(0===t.currentTime&&r&&r===i){const r=Math.ceil(e.at(-1).start/1e3);t.currentTime<r&&(t.currentTime=r,o=!1,e.length=0,n.length=0)}}};r();new MutationObserver((()=>{t!==document.location.href?(t=document.location.href,e.length=0,n.length=0,o=!1,r()):r()})).observe(document,{childList:!0,subtree:!0})}))})();
|
||||
! remove anti-adb
|
||||
!#if (!adguard_ext_firefox)
|
||||
www.youtube.com#%#(()=>{const wrapper=(target,thisArg,args)=>{let result=Reflect.apply(target,thisArg,args);try{const decoded=atob(result);if(decoded.includes('bkaEnforcementMessage')){const modifiedContent=decoded.replace(/\n.\n.auxiliaryUi\.messageRenderers\.bkaEnforcementMessageViewModel\.displayType.\dENFORCEMENT_MESSAGE_VIEW_MODEL_DISPLAY_TYPE_[A-Z]+\n.\n.auxiliaryUi\.messageRenderers\.bkaEnforcementMessageViewModel\.isVisible.{2}(?:tru|fals)e/,'');const encodeToBase64=btoa(modifiedContent);return encodeToBase64}}catch(e){} return result};const handler={apply:wrapper};window.Array.prototype.join=new Proxy(window.Array.prototype.join,handler)})();
|
||||
|
||||
Reference in New Issue
Block a user