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

Side by Side Diff: lib/child/utils.js

Issue 29356087: Issue 4497 - Move Utils.getRequestWindow() into child/utils.js (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created Oct. 6, 2016, 12:18 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 | « lib/child/elemHide.js ('k') | lib/utils.js » ('j') | 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 };
OLDNEW
« no previous file with comments | « lib/child/elemHide.js ('k') | lib/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld