I have a tampermonkey script that i make a while ago.
And i want to improve it so it uses soundcloud's SPA and doesn't reload the page everytime you click on one of the shortcuts.
I have looked at some other questions in stackoverflow and tried many things can't figure out a way for it to work.
For example, if i use history.pushState it does change the URL ! But it doesn't update the page.
function insertButton(playlistname,playlistlink) {
let playlist = document.createElement('Button');
let header = document.querySelector('.header__middle');
playlist.innerHTML = playlistname;
playlist.onclick = function(){ history.pushState({}, '', playlistlink);};
playlist.className = 'playlist-button';
header.insertBefore(playlist, header.children[2]);
}