Skip to content

Commit

Permalink
Update youtube filter exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbr committed Sep 1, 2023
1 parent e1640e5 commit e3387a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions brave-unbreak.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3387a7

Please sign in to comment.