amitbl / blocktube

YouTube™ content blocker
GNU General Public License v3.0
882 stars 62 forks source link

What is the JS code for view based blocking? #241

Closed SakiSakiSakiSakiSaki closed 4 months ago

SakiSakiSakiSakiSaki commented 2 years ago

I don't know anything about JS, and I'd rather not destroy my YouTube client with wrong syntax.

What I have so far is

(video, objectType) => {
  // Add custom conditions below
  if (video.viewCount <= 1000 ) {
  return true;
  }
  // Custom conditions did not match, do not block
  return false;
}

Not sure if this will work or not, would like second opinions. Thanks.

llamatar commented 1 year ago

I tested this code, and it works fine. There isn't any significant risk in playing around with custom functions because incorrect syntax just results in an error appearing in the browser console and other issues can be easily reverted.