OLD | NEW |
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 }; | 112 }; |
113 | 113 |
114 /** | 114 /** |
115 * Checks whether Private Browsing mode is enabled for a content window. | 115 * Checks whether Private Browsing mode is enabled for a content window. |
116 * @return {Boolean} | 116 * @return {Boolean} |
117 */ | 117 */ |
118 let isPrivate = exports.isPrivate = function(/**Window*/ window) | 118 let isPrivate = exports.isPrivate = function(/**Window*/ window) |
119 { | 119 { |
120 return PrivateBrowsingUtils.isContentWindowPrivate(window); | 120 return PrivateBrowsingUtils.isContentWindowPrivate(window); |
121 }; | 121 }; |
| 122 |
| 123 /** |
| 124 * Gets the DOM window associated with a particular request (if any). |
| 125 */ |
| 126 let getRequestWindow = exports.getRequestWindow = function(/**nsIChannel*/ chann
el) /**nsIDOMWindow*/ |
| 127 { |
| 128 try |
| 129 { |
| 130 if (channel.notificationCallbacks) |
| 131 return channel.notificationCallbacks.getInterface(Ci.nsILoadContext).assoc
iatedWindow; |
| 132 } catch(e) {} |
| 133 |
| 134 try |
| 135 { |
| 136 if (channel.loadGroup && channel.loadGroup.notificationCallbacks) |
| 137 return channel.loadGroup.notificationCallbacks.getInterface(Ci.nsILoadCont
ext).associatedWindow; |
| 138 } catch(e) {} |
| 139 |
| 140 return null; |
| 141 }; |
OLD | NEW |