getURL(“javaScript:window.close())”);
が効かなくなったの?
はてな・・頭まわってねえええええ・・・。
getURL(“javaScript:window.close())”);
が効かなくなったの?
はてな・・頭まわってねえええええ・・・。
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Google reCAPTCHA helps protect websites from spam and abuse by verifying user interactions through challenges.
Google Tag Manager simplifies the management of marketing tags on your website without code changes.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.
A video-sharing platform for users to upload, view, and share videos across various genres and topics.
Service URL: www.youtube.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy policy.
「モジラで」への7件の返信
Flash ではちょと確認してないけど、親ウィンドウ(?)では効かないぽいです。子のウィンドウ(タブとかツールバーとかない状態だと効いているのですが、詳細はまだ検証できてないです(´д`)
オデモ検証する暇なし・・(;´Д`)
なんでブロックされたんだろう?
window.opener の有無で判定してるのかなあ?
WinIE とかで「ウィンドウを閉じようとしています」とか言われるウィンドウに相当するものだと閉じないですねー。
アラートだけでも出してほしいなぁ・・・。
このままじゃバグだと思われちゃうね。
困ったー
とりあえず window.opener が存在する(window.open() / a[target] )で開いたときのみ暫定的に閉じるボタン用にスクリプトを書いてみましたー
if(navigator.userAgent.indexOf(“Gecko/”) != -1){
if(window.opener || !window.opener.closed){
var new_paragraph = document.createElement(‘P’);
var new_anchor = document.createElement(‘A’);
var new_anchor_text = document.createTextNode(‘ウィンドウを閉じる’);
new_anchor.setAttribute(‘href’, ‘javascript:void(0);’);
new_anchor.setAttribute(‘onclick’, ‘window.close();’);
new_anchor.setAttribute(‘onkeypress’, ‘window.close();’);
new_anchor.appendChild(new_anchor_text);
new_paragraph.appendChild(new_anchor);
document.body.appendChild(new_paragraph);
}
}
うお。なんかすげえ。要素から生成してるぞ!?
ローカルでは動作しない。
タグにallowScriptAccessを定義。
allowScriptAccess=”sameDomain”
で一応いけるっぽい。
via:maki