-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only works on new page load #2
Comments
yeah def PR this :) Didnt even think about how its a SPA. Some sort of history change event |
Leaving some notes here... I see the main function called is https://github.com/wesbos/who-blue/blob/main/scripts/content.js#L31-L40 Basically we need to "subscribe" to some sort of history change event. Maybe this one:
window.addEventListener('hashchange', e => {
console.log('URL hash changed', e);
doSomething();
});
window.addEventListener('popstate', e => {
console.log('State changed', e);
doSomething();
}); |
I tested both of those by putting them in the Maybe one of these: |
Hey, so I did test both |
Might also consider doing this on |
Potentially a |
See video:
Screen.Recording.2022-11-10.at.8.22.21.AM.mov
The text was updated successfully, but these errors were encountered: