ポップアップとして開くiFrameでサイトを開こうとしています。一部のサイトでは、iFrame(フレームバスティング)で開くことができません。
これを検索しました。私はまたのようないくつかの解決策を持っています
$(window).bind('beforeunload', function (event) {
return 'Custom message.';
});
beforeunloadは、サイト内を移動しているときでも実行されるため、機能しません。
そしてまた私は試しました
// Event handler to catch execution of the busting script.
window.onbeforeunload = function () { prevent_bust++ };
// Continuously monitor whether busting script has fired.
setInterval(function () {
if (prevent_bust > 0) { // Yes: it has fired.
prevent_bust -= 2; // Avoid further action.
// Get a 'No Content' status which keeps us on the same page.
window.top.location.href = 'http://mysiteurl/#';
}
}, 1);
上記も機能していません。iFrameで開かれているURLにリダイレクトされます。
それで、IFrameでサイト(フレームバスターを持っている)を開くための解決策はありますか?
よろしく、Sagar Joshi