Friendly iFrameã§åºåã³ã¼ããé 延èªã¿è¾¼ã¿ãã
æ²æåºæå
çã®æ¼«ç»ã好ããªãã§ããããã®ä¸ã§ãç¹ã«ããã«ã·ãªã³ã©ã³ããã好ãã§ãã
ã¹ãã¼ãªã¼ãè¯ãåºæ¥ã¦ãã¦ç°¡åã«è¨ãã¨å¥³ã®åãã²ããåãã¦ä¸çãæããã話ãªãã§ããããã®ä»ã«ãèªãã¨ã²ããåããã¨ã«å¯¾ããèºèºããç¡ããªã£ã¦ã飲ã¿éãã次ã®æ¥ã§ã復帰ãæ©ããªãã¨ããã¡ãªãããããã¾ãã
WEBãµã¤ãã«ã¢ã¯ã»ã¹ããéã«ãåºåã表示ããã¦ããæ¬æã表示ãããã¨ãããªããã¾ããã¨ããããã§åºåã³ã¼ããé
延èªã¿è¾¼ã¿ããããã¨æãã¾ãã
bodyã¿ã°ã®çµäºç´åã«åºåã®ã¹ã¯ãªããã¿ã°ãé
ç½®ããã®ãæ軽ã§æ¥½ãªã®ã§ããããã®æ¹æ³ã§ã¯çµå±window.onloadã®çºç«ãé
ãã¦ãã¾ãã®ã§ãJavascriptãå¤ç¨ãããµã¤ãã ã¨ãã¾ãæå³ãããã¾ããããªã®ã§ãä»åã¯Friendly iFrameã使ã£ã¦é
延èªã¿è¾¼ã¿ããã¾ãã
Friendly iFrameã¨ã¯ã親ã¨åä¸ãã¡ã¤ã³ã®iframeãåçã«ä½æãããã®ä¸ã«ãµã¼ããã¼ãã£ã¹ã¯ãªãããèªã¿è¾¼ãæ¹æ³ã§ããiframeãªã®ã§ã¬ã³ããªã³ã°ã妨ãã¾ããããSame Origin Policyã«ç¸ãããªãã®ã§è¦ªããã¥ã¡ã³ãã¸ã®ã¢ã¯ã»ã¹ãè¡ããã¨ããç¹ãªã©ãåªãã¦ãã¾ãã
â»åç
§ï¼Friendly iFrame とサードパーティスクリプトのロード - Please Sleep
Friendly iFrameã®å®è£ æ¹æ³ã¯åç´ã§ã
- src å±æ§ã about:self ã«ãã iframe è¦ç´ ãåçã«çæ
- ãµã¼ããã¼ãã£ã® url ãæãã script è¦ç´ ãä½æããiframe å ã®ããã¥ã¡ã³ãã«è¨ç½®
- inDapIF = true ã¨ãããã©ã°ã iframe å ã«ä½ã
ã¨ããã ãã§ããå®éã®å®è£ ç½®ãã¦ããã¾ãã
var parentDom = document.getElementById('parent'); var iframe = document.createElement('iframe'); iframe.width = 300; iframe.height = 250; iframe.frameBorder = "0"; iframe.scrolling = "no"; iframe.marginWidth = 0; iframe.marginHeight = 0; iframe.src = "about:self"; parentDom.appendChild(iframe); var doc = iframe.contentWindow.document; doc.open(); var d = ""; d += '<html><head></head>'; d += '<body>'; d += '<script src="'+src+'"></script>'; d += '<script>inDapIF = true;</script>'; d += '</body></html>'; doc.write(d); doc.close();
ãããªæãã§å®è£
ããã®ã§ãããä½æ
ãå¤ãIEã§åºåã表示ãããªãã¨ããåé¡ãçºçãã¾ããã
ãã¨ã
<script type="text/javascript"> var ad_vars = { ver : xxx, app_id : ddlkajsu }; </script> <script type="text/javascript" src="http://test.com/ad.js"></script>
ã¿ãããªscriptã¿ã°ã®åã«å¤æ°ãã»ããããå¿ è¦ãããã¿ã¤ãã«å¯¾å¿ããã®ãå°ãé¢åã ã£ãã®ã§ã çµå±srcå±æ§ãèªãã¡ã¤ã³ã§ãã¹ãã£ã³ã°ãã¦ããå°ããªhtmlãã¡ã¤ã«ã«åããæ¹å¼ã«å¤æ´ãã¾ããã å¤æ´å¾ã®ã³ã¼ãã¯ãããªãã¾ãã
fif.html
<html> <head> </head> <body> <script type="text/javascript"> var ad_vars = { ver : xxx, app_id : ddlkajsu }; </script> <script type="text/javascript" src="http://test.com/ad.js"></script> </body> </html>
jså´ã§ã¯iframeã®srcã®åãå ã以ä¸ã«å¤æ´ããiframe.contentWindow.documentã¸ã®æä½ãè¡ããªã
iframe.src = "fif.html";
以ä¸ã®å®è£ ã§IEã§ã表示ããã¾ãããå°ããhtmlãã¡ã¤ã«ã¨ã¯è¨ãåççæã«æ¯ã¹ãã¨è¥å¹²ã¢ã¯ã»ã¹ã«æéããããã¨ã¯æãã®ã§ãå¿ è¦ãªãå ´åã¯åççæã®æ¹ãè¯ãã¨ã¯æãã¾ãã
å®è£
ãã¦èªåã§è¦ã¦ã¿ãã¨ãæ¬æãå
¨ã¦è¡¨ç¤ºããã¦ããåºåã¿ã°ãåºã¦ããããé常ã«å¿«é©ã§ããããWEBãµã¤ãã®ããã¹ã姿ã ãããã£ã¨æ®åããã°ãããªã¨æºè¶³ãã¦ããã®ã§ããããã°ãããã¦ããåºååçã確èªãã¦ã¿ããååãããã«ãªã£ã¦ã¦æã«å¸°ãã¾ããã
ãã¯ãåºåã¯ãªãã¯ã®ååãããã¯èªã¿è¾¼ã¿æã®æ¼ãééãã«ãããã®ã¨ããäºã§ãããçããããããé©ç¨ããã¨ãã¯æ°ãã¤ãã¦ãã ããã