From e3387a7027017b48895a675b0bce874b29277316 Mon Sep 17 00:00:00 2001 From: fanboynz Date: Fri, 1 Sep 2023 11:17:35 +0200 Subject: [PATCH] Update youtube filter exception --- brave-unbreak.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brave-unbreak.txt b/brave-unbreak.txt index 89766a82..45a1432f 100644 --- a/brave-unbreak.txt +++ b/brave-unbreak.txt @@ -70,6 +70,9 @@ webplatform.news##+js(aopw, navigator.clipboard) userlytics.com##+js(set, navigator.connection, {}) ! :has youtube.com##ytd-rich-item-renderer:has(ytd-display-ad-renderer) +! youtube.com (importantYT) to get around uBO exception +! https://github.com/uBlockOrigin/uAssets/blob/master/filters/filters.txt#L31 +youtube.com,youtubekids.com,youtube-nocookie.com##+js(rpnt, script, /(\(function serverContract\(\)|writeEmbed|var _F_cssRowKey|importantYT)/, 'const pruner=text=>{let json=JSON.parse(text);for(k of["playerAds","adPlacements","adSlots"]){json[k]=[];}return JSON.stringify(json);};const urlFromArg=arg=>{if(typeof arg==="string"){return arg;}if(arg instanceof Request){return arg.url;}return String(arg);};const realFetch=window.fetch;window.fetch=new Proxy(window.fetch,{apply:function(target,thisArg,args){if(!(urlFromArg(args[0]).includes("player?key="))){return Reflect.apply(target,thisArg,args);}return realFetch(...args).then(realResponse=>realResponse.text().then(text=>new Response(pruner(text),{status:realResponse.status,statusText:realResponse.statusText,headers:realResponse.headers,})));}});window.XMLHttpRequest.prototype.open=new Proxy(window.XMLHttpRequest.prototype.open,{apply:async(target,thisArg,args)=>{if(!(urlFromArg(args[1]).includes("player?key="))){return Reflect.apply(target,thisArg,args);}thisArg.addEventListener("readystatechange",function(){if(thisArg.readyState!==4){return;}const type=thisArg.responseType;if(type!==""&&type!=="text"){return;}const textin=thisArg.responseText;const textout=pruner(textin);if(textout===textin){return;}Object.defineProperty(thisArg,"response",{value:textout});Object.defineProperty(thisArg,"responseText",{value:textout});});return Reflect.apply(target,thisArg,args);}}); $1') 9gag.com##article:has(.promoted) ! Fix browser lockup on skepticalscience.com (https://github.com/brave/brave-browser/issues/5406) ||skepticalscience.net/widgets/heat_widget/js/heat_content.js$script,domain=skepticalscience.com