amitbl / blocktube

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

Context menu 'Block Channel' not working #235

Closed ghost closed 2 years ago

ghost commented 2 years ago

As stated in the title, the context menu 'Block Channel' function no longer works for me. Initially, I thought it was because I maxed out the amount of channels I can block, but when I did it manually, it still works.

8bitDingo commented 2 years ago

Me also, What is curious is that the plugin works normally in a Private window/tab but not in a normal window/tab.

OS Ver: Linux 5.15.0-41-generic #44-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux Browser Ver: Waterfox G4.1.3.1 (64-bit)

I'll try waterfox G4.1.3.2 which has just release but not deployed yet. They have been messing with plugins a lot lately.

seth-js commented 2 years ago

The menuAction variable in the menuOnTap function in inject.js is the problem. It's not getting the text content of the option you choose anymore.

I changed the line to const menuAction = this.getElementsByTagName('yt-formatted-string')[0].getRawText();, and now everything is working as expected. Channels and videos are getting blocked through the menu options.

seth-js commented 2 years ago

Just tested the extension on a chromium-based browser, and everything already works. It looks like this is a bug only present on Firefox and its derivatives. Something's happening where the event's target is losing its text content before the script can do stuff with it.

...string')[0].textContent; works fine on Chrome, but not on Firefox. ...string')[0].getRawText(); works on both.

DarkAlchy commented 2 years ago

Brave browser here (Chromium) and I went to block a few channels today to notice it no longer works via the context menu as well. I updated but there was not a new version to update to that fixes this.

seth-js commented 2 years ago

You'll have to wait until the next release, or load the extension with the new fix manually at brave://extensions/.

amitbl commented 2 years ago

Updated version with this fix should be up in the next hours/day. Thanks @seth-js

8bitDingo commented 2 years ago

Updated and now working again over here. Thank you.