I'm working on a tampermonkey script that lets you edit text on youtube just by clicking the text. I'd also like to edit the suggested videos on YouTube, but to do that, I need to disable the links temporarily. linkElement.onclick = function(e){return false;}; works for most links, but for some reason, it doesn't work on YouTube links. Would somebody know why this doesn't work?
Example of it working usually:
<a id='testlink' href='http://stackoverflow.com'>Test link</a>
<br />
<button onclick='document.getElementById("testlink").onclick=function(e){return false;};'>Disable link</button>
Like I said, this doesn't work on YouTube, and I don't know what code they use for their links. I think it has something to do with how it always seems to be one seamless page.