To make tabs for Info, Comments, Videos and Playlist
< Feedback on Tabview YouTube Totara
Correction - Should be "youtube/watch*" without the second slash or it stops working on videos. I realize this is only a workaround, because the menu from the other script should also appear on video pages, but it's easier to do than finding the conflict.
Update: My fix is not that good unfortunately, it only works at full page refresh which does not happen when clicking on a video from the homepage. So the actual conflict should be found, but I don't know how easy that is, or whether you should do it or the other dev. I'm not proficient enough at JS to find it.
YouTube is Single Page App.
We always do https://www.youtube.com/*
Otherwise your scripts would not trigger when you navigate from the home page.
Thanks for reporting. I will check with this compatibility issue later.
His script is doing something wrong. His script made a compatibility issue.
delete these lines from his script.
// Needed to bypass YouTube's Trusted Types restrictions, ie.
// Uncaught TypeError: Failed to set the 'innerHTML' property on 'Element': This document requires 'TrustedHTML' assignment.
if (window.trustedTypes?.createPolicy) {
window.trustedTypes.createPolicy('default', {
createHTML: (string, _sink) => string,
});
}
or replace them with my version
if (typeof trustedTypes !== 'undefined' && trustedTypes.defaultPolicy === null) {
let s = s => s;
trustedTypes.createPolicy('default', { createHTML: s, createScriptURL: s, createScript: s });
}
Thank you for looking into this so quickly, and even coming up with a solution! I've tried your fix, it works.
Nice script, thank you. I've found a compatibility issue with the following script:
https://greasyfork.org/en/scripts/13040-youtube-hide-watched-videos
When both are active, the above script does not work (Menu doesn't show up).
I solved this for the homepage by changing the MATCH attribute for Tabview to "youtube/watch/*" instead of "youtube/*".
Maybe it should be like that by default? Tabview isn't necessary on the homepage I think?