Block YouTube Ads on Brave Browser



Hey there,

I have noticed YouTube ads in Brave browser. Fair enough, YouTube has launched non-skippable ads in videos. May be a good challenge to brave browser again. It is definitely blocking most, but not every now and then i’ll play a full length 20/30 seconds unskipable ads.

I have tried updating to latest version of the browser, but still the problem remain same after logging account. May be someone experiencing such issue and carrying their loads on other browsers.

Here is what I found, after some research I came up know with the solution for skipping ads.

Just go to
brave://settings/shields/filters

there you will get a option for “create custom filters” with a box below it.
Save the following code:
youtube.com##+js(set-trusted-types)
youtube.com##+js(trusted-rpnt, script, (function() {window.ytplayer=, '/*start*/(()=>{let t=document.location.href;let e=[];let n=[];let o=false;let r="";const i=Array.prototype.push;const a={apply:(t,r,a)=>{if(window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id&&a[0]&&a[0]!==window&&typeof a[0].start=="number"&&a[0].end&&a[0].namespace==="ssap"&&a[0].id){if(!o&&a[0]?.start===0&&!n.includes(a[0].id)){e.length=0;n.length=0;o=true;i.call(e,a[0]);i.call(n,a[0].id)}if(o&&a[0]?.start!==0&&!n.includes(a[0].id)){i.call(e,a[0]);i.call(n,a[0].id)}}return Reflect.apply(t,r,a)}};window.Array.prototype.push=new Proxy(window.Array.prototype.push,a);document.addEventListener("DOMContentLoaded",(function(){if(!window.yt?.config_?.EXPERIMENT_FLAGS?.html5_enable_ssap_entity_id){return}const i=()=>{const t=document.querySelector("video");if(t&&e.length){const i=Math.round(t.duration);const a=Math.round(e.at(-1).end/1e3);const c=n.join(",");console.log(t.currentTime,r,i,a,"uBO");if(t.loop===false&&r!==c&&i&&i===a){const adsTime=e.at(-1).start/1e3;console.log(JSON.stringify(e),JSON.stringify(n),r,adsTime,t.currentTime,"uBO");if(t.currentTime<adsTime){t.currentTime=adsTime;o=false;r=c}}else if(t.loop===true&&i&&i===a){const adsTime=e.at(-1).start/1e3;if(t.currentTime<adsTime){t.currentTime=adsTime;o=false;r=c}}}};i();new MutationObserver((()=>{if(t!==document.location.href){t=document.location.href;e.length=0;n.length=0;o=false;i()}else{i()}})).observe(document,{childList:true,subtree:true})}))})();if(window.trustedTypes){const escapeHTMLPolicy=trustedTypes.createPolicy("myEscapePolicy",{createScript:string=>string.replace(/\/\*start\*\/(.*)\/\*end\*\//g,"")});document.currentScript.textContent=escapeHTMLPolicy.createScript(document.currentScript.textContent)}else{document.currentScript.textContent=document.currentScript.textContent.replace(/\/\*start\*\/(.*)\/\*end\*\//g,"")}/*end*/(function() {window.ytplayer=', sedCount, 1)
youtube.com##+js(nano-stb, [native code], 17000, 0.001)


This code is in the syntax of adblock filter, copy and paste the entire code.

or you can copy from the link:
https://gist.githubusercontent.com/Yuki2718/1a962af14c72aff65e907d7750f45af4/raw/ee5e90b1f8e7a1f603e59e0878378a4d5391638c/gistfile1.txt

and click on save changes.
After reloading YouTube, you will be able to surf ads free YouTube.

check out more such contents on
https://medium.com/@karanveerthakur1122

Comments

Popular Posts