It wasn’t until yesterday that I discovered the concept of bookmarklets to access a web page’s DOM. I want to use it to capture the currently playing song on a radio station website and send it to my own database. It works fine, but the fetch statement throws CORS errors. They don’t break the script, but it looks kind of ugly. Here’s my bookmarklet:
javascript: (function() {
// some code to get the current playing song (myArtist, myTitle and myStartTime)
let url="https://www.mywebsite.com/insert_song.aspx?artist="+myArtist+"&title="+mySong+"&tstart="+myStartTime;
fetch(url);
})();
I have no administrative rights on my website to configure CORS, so what other options are there to avoid these CORS errors?