Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 }; | 88 }; |
89 | 89 |
90 let documentElement = window.document && window.document.documentElement; | 90 let documentElement = window.document && window.document.documentElement; |
91 if (documentElement) | 91 if (documentElement) |
92 frame.sitekey = documentElement.getAttribute("data-adblockkey") | 92 frame.sitekey = documentElement.getAttribute("data-adblockkey") |
93 | 93 |
94 frames.push(frame); | 94 frames.push(frame); |
95 window = (window != window.parent ? window.parent : null); | 95 window = (window != window.parent ? window.parent : null); |
96 } | 96 } |
97 | 97 |
98 // URLs like about:blank inherit their security context from upper-level | 98 // URLs like about:blank inherit their security context from upper-level |
Thomas Greiner
2015/11/10 18:41:23
So with "URLs like about:blank" you mean "about:bl
Wladimir Palant
2015/11/11 08:01:28
No, normally that's protocol-dependent - data:, ja
| |
99 // frames, resolve their URLs accordingly. | 99 // frames, resolve their URLs accordingly. |
100 for (let i = frames.length - 2; i >= 0; i--) | 100 for (let i = frames.length - 2; i >= 0; i--) |
101 { | 101 { |
102 let frame = frames[i]; | 102 let frame = frames[i]; |
103 if (frame.location == "about:blank" || frame.location == "moz-safe-about:bla nk" || | 103 if (frame.location == "about:blank" || frame.location == "moz-safe-about:bla nk" || |
104 Utils.netUtils.URIChainHasFlags(Utils.makeURI(frame.location), Ci.nsIPro tocolHandler.URI_INHERITS_SECURITY_CONTEXT)) | 104 Utils.netUtils.URIChainHasFlags(Utils.makeURI(frame.location), Ci.nsIPro tocolHandler.URI_INHERITS_SECURITY_CONTEXT)) |
105 { | 105 { |
106 frames[i].location = frames[i + 1].location; | 106 frame.location = frames[i + 1].location; |
Thomas Greiner
2015/11/10 18:41:23
Detail: You already have a reference to `frame[i]`
Wladimir Palant
2015/11/11 08:01:28
Done.
| |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 return frames; | 110 return frames; |
111 }; | 111 }; |
112 | 112 |
113 /** | 113 /** |
114 * Checks whether Private Browsing mode is enabled for a content window. | 114 * Checks whether Private Browsing mode is enabled for a content window. |
115 * @return {Boolean} | 115 * @return {Boolean} |
116 */ | 116 */ |
117 let isPrivate = exports.isPrivate = function(/**Window*/ window) | 117 let isPrivate = exports.isPrivate = function(/**Window*/ window) |
118 { | 118 { |
119 return PrivateBrowsingUtils.isWindowPrivate(window); | 119 return PrivateBrowsingUtils.isContentWindowPrivate(window); |
120 }; | 120 }; |
LEFT | RIGHT |