Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: common.js

Issue 29338436: Issue 3814 - Opening sharing pop-up fails starting with Firefox 47 (Closed)
Patch Set: Created March 16, 2016, 2:05 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // Firefox 38+ no longer allows messaging using postMessage so we need 67 // Firefox 38+ no longer allows messaging using postMessage so we need
68 // to have a fake top level frame to avoid problems with scripts that try to 68 // to have a fake top level frame to avoid problems with scripts that try to
69 // communicate with the first-run page 69 // communicate with the first-run page
70 var isGecko = ("Components" in window); 70 var isGecko = ("Components" in window);
71 if (isGecko) 71 if (isGecko)
72 { 72 {
73 try 73 try
74 { 74 {
75 var Ci = Components.interfaces; 75 var Ci = Components.interfaces;
76 iframe.contentWindow 76 var docShell = iframe.contentWindow
77 .QueryInterface(Ci.nsIInterfaceRequestor) 77 .QueryInterface(Ci.nsIInterfaceRequestor)
78 .getInterface(Ci.nsIDocShell) 78 .getInterface(Ci.nsIDocShell);
79 .setIsBrowserInsideApp(Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID); 79
80 if (typeof docShell.frameType != "undefined")
81 {
82 // Gecko 47+
83 docShell.frameType = docShell.FRAME_TYPE_BROWSER;
84 }
85 else
86 {
87 // Legacy branch
88 docShell.setIsBrowserInsideApp(Ci.nsIScriptSecurityManager.UNKNOWN_APP _ID);
89 }
80 } 90 }
81 catch(ex) 91 catch(ex)
82 { 92 {
83 console.error(ex); 93 console.error(ex);
84 } 94 }
85 } 95 }
86 96
87 var popupMessageReceived = false; 97 var popupMessageReceived = false;
88 function resizePopup(width, height) 98 function resizePopup(width, height)
89 { 99 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 147 }
138 148
139 iframe.removeEventListener("load", popupLoadListener); 149 iframe.removeEventListener("load", popupLoadListener);
140 }; 150 };
141 iframe.addEventListener("load", popupLoadListener, false); 151 iframe.addEventListener("load", popupLoadListener, false);
142 152
143 iframe.src = url; 153 iframe.src = url;
144 glassPane.className = "visible"; 154 glassPane.className = "visible";
145 } 155 }
146 })(this); 156 })(this);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld