Utilizing history.js, I am attempting to push a state change from an HTTP site like:
http://www.example.com/some/resource
...to a secure site (payment page), such as:
https://www.example.com/payment/for/some/resource
However, Safari is throwing this error:
SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
...when trying to push the state change with code like:
History.pushState(null, null, new_state_url);
// new_state_url = https://www.example.com/payment/for/some/resource
After investigating, I came across this Stack Overflow question, which points towards the Same Origin Policy being the issue because I am trying to push a state change across different protocols. The suggestion there was to explicitly include the full URL, but even after doing so, I still encountered the same error.
Within my project scope, I am developing a mobile version of my website and want the payment page to load seamlessly using AJAX, similar to my other page loads that utilize jQuery's $.ajax
with custom animations resembling those in jQuery Mobile.
Is it feasible for me to successfully push this state change across SSL? If yes, what steps should I take?