When I make a chrome extension for youtube with userscript in Tampermonkey or as a Chrome Extension the extension doesn't recognize when it leaves the page that the extension should run on like it normally would because of the history.push function that has been implemented recently. So for example:
// @include http://www.youtube.com/feed/subscriptions
I did this so it should only run when I go to my subscriptions but when I click a video it keeps loading the extension. When I turn it into a chrome extension the problem persists.
How can I see if it is on a certain youtube-page to then run my code?