What a silly bug. I wondered why this doesn't work on Greasemonkey. Eventually I replaced all of the code in the script with just a
console.log(), and that didn't do anything either. The culprit is
@run-at document-body. Greasemonkey doesn't support that. By changing it to
@run-at document-start, the script works.
But it didn't fix the links, just the URL of the current page. I added another logging call, and noticed that it found just one link to clean up. Seems that all the links to other products on the page are lazy-loaded, so they're not caught by this script. So it looks to me like you could remove all of the
whenReady() stuff, and only do the