ブラウザにはjavascriptのコードがそのウインドウにアクセスすることができるか same origin policy に従ってチェックしている部分があります。この部分はセキュリティチェックと呼ばれています(FirefoxではnsScriptSecurityManager, WebKitではSecurityOriginで実装されている)。 Firefoxはjavascriptのオブジェクトひとつひとつに、そのオブジェクトを定義したページのドメインをもとにprincipalを設定し、実行時にアクセスしようとしているオブジェクトのprincipalと実行コンテキストのprincipalが一致するかをチェックすることで same origin policy を実装しています。Firefoxは実行コンテキストがネイティブコードや拡張機能由来のもののときには、常にprincipalが一致するもの