You are right that they cannot be added to History, but the code used here changes the back button functionality with
$(window).on('popstate', function() {
window.location.href = 'https://example.com';
});
I just tested it and it works with different domain in latest Firefox.