在iFrame中加载第三方Web应用程序。提供的用于处理Cookie的javascript代码在iOS浏览器中不起作用,请有人可以提供solutin:
<script language="javascript">
(function() {
if (typeof window.addEventListener !== "undefined") {
window.addEventListener("message", messageReceived, false);
}
function messageReceived(e) {
var data;
if (e.origin !== "https://whitelabel-3rd-party.com") {
return;
}
try {
data = JSON.parse(e.data);
} catch (err) {
return;
}
if (typeof data !== "object" || typeof data.event !== "string" || typeof data.data === "undefined") {
return;
}
if (data.event === "safariCookieFix") {
window.location.href = e.origin + "/en-gb/cookiefix?redirectUrl=http(s)://www.mydomain.com/online-auction";
return;
}
}
})();
</script>