Open drzraf opened 1 year ago
Small up on this one since it paves the way to #133 in an elegant way.
To add on this conversation I've achieved whitelisting without breaking any other aspects of youtube with the following code:
(video, objectType) => {
// List of allowed Channels
const allowList = new Set([
"Channel1",
"Channel2",
]);
// Do not remove comments and video information
const allowedObjects = new Set([
"guideEntryRenderer",
"videoPrimaryInfoRenderer",
"videoSecondaryInfoRenderer",
"commentRenderer",
"videoDetails"
])
// Block the video
if (video.channelId.length == 24 && !allowList.has(video.channelName.trim()) && !allowedObjects.has(objectType)) return true;
// Custom conditions did not match, do not block
return false;
}
I find the idea to store the channel names in a local file to be very nice. Will maybe work on a way to actually implement it like this and create a PR.
Whitelisting isn't supported for now (#133).
An alternative is to do it programmatically using an advanced blocking. but it would be handy to reuse configuration (so my whitelisted channel live inside the configuration instead of being hardcoded into the script).
Sadly,
chrome
isn"t available inside the content scriptCoudn't this be implemented to make it more powerful and act as an efficient way to create a variety of workarounds for other missing core-features?