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

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

Issue 29352659: Issue 4406 - Treat about:srcdoc as not having an own security context, inherit document origin (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created Sept. 12, 2016, 11:57 a.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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 frame.location == "about:srcdoc" ||
104 Utils.netUtils.URIChainHasFlags(Utils.makeURI(frame.location), Ci.nsIPro tocolHandler.URI_INHERITS_SECURITY_CONTEXT)) 105 Utils.netUtils.URIChainHasFlags(Utils.makeURI(frame.location), Ci.nsIPro tocolHandler.URI_INHERITS_SECURITY_CONTEXT))
105 { 106 {
106 frame.location = frames[i + 1].location; 107 frame.location = frames[i + 1].location;
107 } 108 }
108 } 109 }
109 110
110 return frames; 111 return frames;
111 }; 112 };
112 113
113 /** 114 /**
114 * Checks whether Private Browsing mode is enabled for a content window. 115 * Checks whether Private Browsing mode is enabled for a content window.
115 * @return {Boolean} 116 * @return {Boolean}
116 */ 117 */
117 let isPrivate = exports.isPrivate = function(/**Window*/ window) 118 let isPrivate = exports.isPrivate = function(/**Window*/ window)
118 { 119 {
119 return PrivateBrowsingUtils.isContentWindowPrivate(window); 120 return PrivateBrowsingUtils.isContentWindowPrivate(window);
120 }; 121 };
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