ExternalInterface 経由で HTML 要素を削除すると、Safari が落ちる

March 31, 2009category: Flash JavaScript 

以下の条件で Windows 版 Safari 3.2.2 が 100% 落ちる。

  • ExternalInterface 経由で、SWF 自身が置いてある HTML 要素を削除する。
  • フレームスクリプトで ExternalInterface を呼び出す。
  • その SWF の wmode が transparent である。

ActionScript

//in crash.swf
ExternalInterface.call("hoge");

JavaScript

var so = new SWFObject(...);//crash.swf
so.addParam("wmode", "transparent");
so.write("swfContainer");

function hoge() {
  document.body.removeChild(document.getElementById("swfContainer"));
}

デモ

http://blog.kaihatsubu.com/files/safari-crash/

comments (0)

comments