### Blocktube Filter Examples Source: https://github.com/amitbl/blocktube/wiki/Filters-Options Examples demonstrating the syntax for creating filters in Blocktube. This includes simple keyword matching and the use of regular expressions for more complex pattern matching. Regular expressions should not use the global 'g' flag. ```text // match all videos that contains the word "vlog" vlog // match all videos containing two or more '!' in a row /!{2,}/i ``` -------------------------------- ### Blocktube Foreign Language Filter Example Source: https://github.com/amitbl/blocktube/wiki/Filters-Options An example illustrating how to use regular expressions to filter content in foreign languages, specifically when keywords are not separated by spaces. This ensures accurate blocking of terms like Japanese characters. ```text // To block a video with a title 【閃の軌跡シリーズ】全・オープニング集『閃Ⅰ改&閃Ⅱ改&閃Ⅲ&閃Ⅳ』【オールPS4版】【1080p60fps】 // You should make your "Video title" filter /閃の軌跡/ instead of 閃の軌跡 ``` -------------------------------- ### Build BlockTube Extension for Firefox and Chrome (Bash) Source: https://github.com/amitbl/blocktube/blob/master/README.md This script builds the BlockTube extension package for Firefox and Chrome. It requires Node.js, npm, and terser to be installed. The script first installs build requirements, clones the repository, and then executes build commands for each browser. Output packages are located in the 'dist' directory. ```Bash # Install build requirements sudo apt install nodejs npm sudo npm install -g terser # Clone Repo git clone https://github.com/amitbl/blocktube ### Make your changes ### # Build package ./tools/build.sh firefox ./tools/build.sh chrome # Output packages locations ./dist/firefox/blocktube_firefox_VERSION.zip ./dist/chrome/blocktube_chrome_VERSION.zip # Temporary installation / debugging # Firefox: https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/ # Chrome: https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked ``` -------------------------------- ### JavaScript Advanced Blocking Rule Example Source: https://github.com/amitbl/blocktube/wiki/Advanced-Blocking This JavaScript code snippet demonstrates a custom blocking rule for BlockTube. It takes 'video' and 'objectType' as arguments and returns a boolean to indicate whether the video should be blocked. It includes an example of excluding recommendations and blocking videos based on title and channel name. ```javascript (video, objectType) => { // Add custom conditions below // Don't touch recommendations on video pages if (objectType === 'compactVideoRenderer') { return false; } // If video title contains "something" // and If the channel name contains "otherthing" if (video.title.match("something") && video.channelName.match("otherthing")) { // Block the video return true; } // ... more conditions ... // Custom conditions did not match, do not block return false; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.