pietervanheijningen / clickbait-remover-for-youtube

Replaces thumbnails and modifies titles of videos on youtube.com
https://chrome.google.com/webstore/detail/clickbait-remover-for-you/omoinegiohhgbikclijaniebjpkeopip
MIT License
373 stars 24 forks source link

Brave update partially broke this #56

Open Rowsol opened 1 year ago

Rowsol commented 1 year ago

it still technically works, but it requires that you toggle it off and on each time you visit youtube.

pietervanheijningen commented 1 year ago

Hey! For me it still works. So it's probably an A/B test from youtube, which makes this a bit hard to test.

Can you make a screenshot of the HTML of the thumbnail that has not changed? Like so: with inspect element

image

Then i should be able to figure out why it is not changing for you. Probably the src url in the img tag is different on your youtube version.

Thanks!

Rowsol commented 1 year ago

I hope this helps Screenshot (348)

pietervanheijningen commented 1 year ago

Sorry did not explain it clearly, can you also expand the yt-image HTML tag? So I can see the actual image URL? like on my screenshot

Rowsol commented 1 year ago

I hope this is right, this stuff is a bit over my head.

Screenshot (349)

theshatterstone commented 1 year ago

Same here. Titles still work, but the thumbnails don't until I set the toggles again. Here's the picture Screenshot_2023-06-04_20-50-59

Also, I just noticed something. I use Firefox as well and it works perfectly on Firefox. All the screenshots posted so far are from Brave browser. It seems it might be an issue stemming from either Chromium-based browser, or from Brave itself.

Rowsol commented 1 year ago

Yeah, it appears to be an issue with Brave. Thanks for the heads up. I just posted a bug report on brave's github. Time will tell if they care enough to fix it.

Izofeu commented 1 year ago

I found a dirty fix for impatient people like me: Edit the extension - file youtube.js: Add

function fixfix()
{
    updateThumbnails("hq2");
}

setInterval(fixfix, 1000);

somewhere in the code and run. Dirty and bad fix, but at least makes Youtube usable.

Rowsol commented 1 year ago

I found a dirty fix for impatient people like me: Edit the extension - file youtube.js: Add

Can you elaborate? Where do you get this extension?

Izofeu commented 1 year ago
  1. Go to %localappdata%\BraveSoftware\Brave-Browser\User Data

  2. Look for "omoinegiohhgbikclijaniebjpkeopip"

  3. Open the folder, copy 0.8_0 folder onto somewhere else

  4. Remove the extension from Brave

  5. Delete _metadata folder from the copied folder

  6. Open 0.8_0\js\youtube.js

  7. Paste the code from above somewhere into the file, I pasted it here (a fragment of code was provided):

    chrome.runtime.onMessage.addListener(function (message) {
        Object.keys(message).forEach(function (change) {
            switch (change) {
                case 'preferred_thumbnail_file':
                    updateThumbnails(
                        message[change].newValue === undefined ? 'hq1' : message[change].newValue
                    );
                    break;
                case 'video_title_format':
                    updateCSS(message[change].newValue);
                    break;
            }
        })
    });
    //
        // I PASTED THE CODE HERE
        //
    function fixfix()
    {
                // REPLACE HQ2 WITH TYPE OF THUMBNAIL YOU WANT - hq1 START, hq2 MIDDLE, hq3 END
        updateThumbnails("hq2");
    }
    
    setInterval(fixfix, 1000);
    
        // 
        // END OF PASTED CODE
        // 
    
    function updateCSS(option) {
    
        let appendingElement = false;
    
        if (window.styleElement === null) {
            appendingElement = true;
            window.styleElement = document.createElement('style');
        }
  8. Open Extensions in Brave

  9. Enable Developer mode in top right

  10. Click load unpacked

  11. Select the 0.8_0 folder (that has manifest.json in it)

  12. Click load We need to do all these steps as extensions are signed and altering the code of signed extensions will prevent them from running.

Rowsol commented 1 year ago

Very much appreciated!

pietervanheijningen commented 1 year ago

Hi everyone, thanks for the temporary fix @Izofeu. But a proper fix should be possible, likely just something has to be changed in how the thumbnail url listeners are setup. Specifically here: https://github.com/pietervanheijningen/clickbait-remover-for-youtube/blob/72a37edf345999d73f67486e3a1431058de18638/js/background.js#L51

Unfortunately the extension still works fine for me, this is probably due to an A/B test from youtube or Brave, which is why it is broken for some people. Strangely enough the URL to the thumbnail still seems to be the same, which is why I asked for the screenshots. So i'm a bit stumped on what it could possibly be, for me its just a guessing game.

Hoping someone who has this A/B test can figure it out and submit a pull request.

Edit: Only just realised for some reason you guys are only talking about the Brave browser. I'll see soon if I can also replicate the issue and fix it. Bit busy at the moment.

Izofeu commented 1 year ago

Hi everyone, thanks for the temporary fix @Izofeu. But a proper fix should be possible, likely just something has to be changed in how the thumbnail url listeners are setup. Specifically here:

https://github.com/pietervanheijningen/clickbait-remover-for-youtube/blob/72a37edf345999d73f67486e3a1431058de18638/js/background.js#L51

Unfortunately the extension still works fine for me, this is probably due to an A/B test from youtube or Brave, which is why it is broken for some people. Strangely enough the URL to the thumbnail still seems to be the same, which is why I asked for the screenshots. So i'm a bit stumped on what it could possibly be, for me its just a guessing game.

Hoping someone who has this A/B test can figure it out and submit a pull request.

Edit: Only just realised for some reason you guys are only talking about the Brave browser. I'll see soon if I can also replicate the issue and fix it. Bit busy at the moment.

If you need any assistance in troubleshooting this issue, I'm more than happy to help. Sorry for my spaghetti fix but I'm not much of a coder 😃 I created a separate instance of Brave Browser and this doesn't happen (when I'm logged out) so looks like it's something related to my Google account.

I-am-the-Users commented 1 year ago

The problem is fixed after deleting these two folders.

edit: it doesn't work again...

andrzejgrzelak commented 1 year ago

I looked into this and I'm pretty sure it's connected to this issue: https://github.com/brave/brave-browser/issues/30854

I can confirm that if you disable&enable the extension it works until the browser restart

pietervanheijningen commented 1 year ago

I looked into this and I'm pretty sure it's connected to this issue: brave/brave-browser#30854

I can confirm that if you disable&enable the extension it works until the browser restart

Thanks for this finding! Almost certain that that is the issue then. Hope brave fixes it soon, Kind of odd that brave deviates from standard chromium behaviour. Don't really feel like I am doing very advanced/weird things with my extension.

Mhowser commented 1 year ago

FYI DeArrow works on brave, I've been testing it out and I think I'm gonna just replace CBR with DeArrow.

jrejaud commented 1 year ago

FYI DeArrow works on brave, I've been testing it out and I think I'm gonna just replace CBR with DeArrow.

Second DeArrow. I am a big fan of CBR but I think DeArrow is a bit better, total clickbait death is non-negotiable for me.

pietervanheijningen commented 9 months ago

Appears to be fixed in the latest brave update according to https://github.com/pietervanheijningen/clickbait-remover-for-youtube/issues/66?

Issue on brave's side is now also closed, with people verifying that this extension now works properly again: https://github.com/brave/brave-browser/issues/30854