I'm writing my first Chrome extension and it's pretty simple. On YouTube, whenever you go to a channel's page there's usually a video (often a channel promo video) that autoplays, is annoying, and shows up in my history (another minor annoyance). I wrote a chrome extension to change anything of the form "https://www.youtube.com/user/*
" to "https://www.youtube.com/user/*/videos
" and redirect immediately to their videos page.
This works brilliantly if I type the URL into the address bar, but it doesn't seem to work if I click a link to the channel when I'm already on YouTube. My guess is that somehow YouTube is changing pages without "telling" Chrome that the page is changing and therefore my extension isn't recognizing it.
How can I best fix this? I'd rather not write a loop to check constantly if there's a URL that matches (I think there'd be memory issues, but I'm new to this so correct me if I'm wrong).
Let me know if you want to see my files.