| Index: common.js |
| =================================================================== |
| --- a/common.js |
| +++ b/common.js |
| @@ -68,20 +68,30 @@ |
| // to have a fake top level frame to avoid problems with scripts that try to |
| // communicate with the first-run page |
| var isGecko = ("Components" in window); |
| if (isGecko) |
| { |
| try |
| { |
| var Ci = Components.interfaces; |
| - iframe.contentWindow |
| + var docShell = iframe.contentWindow |
| .QueryInterface(Ci.nsIInterfaceRequestor) |
| - .getInterface(Ci.nsIDocShell) |
| - .setIsBrowserInsideApp(Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID); |
| + .getInterface(Ci.nsIDocShell); |
| + |
| + if (typeof docShell.frameType != "undefined") |
| + { |
| + // Gecko 47+ |
| + docShell.frameType = docShell.FRAME_TYPE_BROWSER; |
| + } |
| + else |
| + { |
| + // Legacy branch |
| + docShell.setIsBrowserInsideApp(Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID); |
| + } |
| } |
| catch(ex) |
| { |
| console.error(ex); |
| } |
| } |
| var popupMessageReceived = false; |