Open mholtstrom opened 6 months ago
Hey @mholtstrom that's great what you're trying to do for your kid!
Unfortunately don't have time to update this except getting to manifest v3 which is due soon by June. Any updates currently might be for naught until its updated to v3 first since chrome will stop working on v3 after june deadline, hope to have time to release by end of april.
yea that whitelist extension looks perfect except for its over privileged settings.
You can try this if you have time and think its worth it, please share with me if you get it working, thanks
const allowedChannelIds = ['a', 'b']
channelId = response.items[0].snippet.channelId;
chrome://extensions/
which is necessary to add back your custom extension from your files. They can't just redownload the extension from the chrome store since yours is a custom local one. Thinking you can block the site from your router or use a computer website blocker with password + uninstall protection (you may already have one) like coldturkey blocker or focusme (I use this, very difficult to break and has uninstall protections)sample code i found from another extension
var xhr = new XMLHttpRequest(),
id = this.getParam(location.href.slice(location.href.indexOf("?") + 1), "v");
xhr.open("GET", "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + id + "&key=" + key, false);
xhr.send();
if (xhr.readyState === xhr.DONE && xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
id = response.items[0].snippet.channelId;
Also regarding these points
Block shorts as well as full videos.
Not sure if this will also block shorts, unhook chrome extension can hide shorts
When navigating youtube, block all display of non-whitelisted suggestions/
That will be more difficult to implement, I suggest using the chrome extensions listed below instead, though they can be edited, it's best to just hide all the addicting YouTube recommendations, Home Screen, side bar, subscriptions, comments, etc.
Thinking you could just have a book mark folder for the white listed channels and they can click into any of the videos on the channel page.
Thanks for the detailed reply. I also got replies from safetube and youtube-warden. Since you're not on manifest v3 and since youtube-warden
already has a white-list, I'll experiment with that first. I may come back to yours though.
I understood your instructions about updating content.js
but looking at onHistoryStateUpdated.addListener
, I don't understand how that blocks embedded videos. Will it work on a page like this? Maybe you get onHistoryStateUpdated
not only for the main page but also for all embeds?
Thanks also for the analysis about disabling the extension. Actually on ChromeOS the child needs a parent password to add extensions, and youtube-warden says there is a way to prevent them from removing extensions, although it looked like it needed console access which I haven't tried on ChormeOS.
Thanks for the DF and Unhook suggestions. I submitted a whitelist feature request to Unhook. But I would prefer them to be open source, and I really need the whitelist. For now I'm using YouTube Blocker but I hope to switch to youtube-warden
. And rather then try to cleanup the YouTube navigation, I think I'll just make a bookmark page of channels and block all of youtube that isn't an approved channel or a video from an approved channel.
Actually on ChromeOS the child needs a parent password to add extensions, and https://github.com/maninalift/youtube-warden/issues/1 says there is a way to prevent them from removing extensions, although it looked like it needed console access which I haven't tried on ChormeOS.
That's really really nice, then extension passwords are very useful yea
I understood your instructions about updating
content.js
but looking atonHistoryStateUpdated.addListener
, I don't understand how that blocks embedded videos. Will it work on a page like this? Maybe you getonHistoryStateUpdated
not only for the main page but also for all embeds?
This extension doesn't work on embeded websites, think would need to
1) increase site access scope beyond youtube, which I feel might not be worth it, wanted to keep scope just within youtube.com, not a catch all for embedded videos
2) somehow detect an embedded video on the html tags like check for iframe src="http://www.youtube.com/embed/youtubeVideoIdHere
, then call youtube data api for that video id to get category / channel type data to block/not block
<iframe id="player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com" frameborder="0"></iframe>
[screenshot 1]
will let you know when get to v3, maybe can add a whitelist then
Ok. Thanks for all the info. In my case on ChromeOS with FamilyLink I give per-domain access. So if I don't want her seeing embedded videos on say TedEd then I should just not grant access to that domain at all. But since I do want to grant TedEd and since the videos are from YouTube, I must grant FamilyLink access to YouTube. But then I've granted all of YouTube. So I think your extension's logic is sufficient. I think I want to:
@eric60 I'm a developer who wants to configure his 7-year-old's ChromeBook (that is controlled via FamilyLink) to only be able to browse and play videos based on a whitelist of channels (like TedEd). From my investigation so far, this isn't supported by Google/Chromebook/FamilyLink/YouTube. A chrome extension seems like my best bet. My full analysis is at https://holtstrom.com/michael/blog/post/735/Internet-for-Kids.html And you can reach me at [chromeapps at holtstrom.com] Would you consider adding this to your extension? If you have any advice for me in building my own version, I'd appreciate it.