Posting to Wayback Machine Via Bookmarklet
You are certainly going to get a CORS problem if you try to use XMLHttpRequest across domains, and that is exactly what you are doing in your new window, because it isn't the same domain as web.archive.org. The closest solution to what you code is trying to do is to write an HTML form to the new window with method=post
and submit it, rather than use XMLHttpRequest.
I think, however, that you got confused and started down the wrong path for the wrong reason. This works fine.
window.open("http://web.archive.org/save/" + document.location.href);
As does this
window.open("http://web.archive.org/save/" + encodeURI(document.location.href));
But, somewhat surprisingly, this does not
window.open("http://web.archive.org/save/" + encodeURIComponent(document.location.href));