amitbl / blocktube

YouTube™ content blocker
GNU General Public License v3.0
907 stars 64 forks source link

[Feature Request] Exclude search page blocking #404

Open misspent opened 5 months ago

misspent commented 5 months ago

I have attempted numerous times to create a snippet to prevent videos from being removed from the search page. Due to my inexperience, the snippet(s) haven't worked, but I enjoy playing with them. I'd appreciate any help or support anyone can give, and if you do end up making this a feature, then the world is complete. Thank you for this quality extension, and please keep it up.

Example 1:

    // Don't touch search result page
    if (objectType === 'ytd-search ytd-rich-item-renderer') {
        return true;
    }

Example 2:

    // Removes videso that were streamed
    if (window.location.href.startsWith('https://www.youtube.com/results')) {
        return false
    }
xavieraiden commented 5 months ago

From what I can see. You've mixed up the return true; and return false;. Number one, you forgot a semicolon on your return false;. Second, return true; is actually what blocks videos, so you would want to return true; when blocking something and return false; when not. Otherwise, I'm also somewhat inexperienced so I can't really help you elsewhere.

misspent commented 5 months ago

I missed that semicolon, but I grasped the general purpose of return, thankfully. Thanks for the heads-up and response. I'll be sure to watch for syntax errors going forward.