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

Delta Between Two Patch Sets: lib/child/contentPolicy.js

Issue 29336233: Issue 3568 - Block pop-ups opened via an intermediate window (Closed)
Left Patch Set: Created Feb. 10, 2016, 3:10 p.m.
Right Patch Set: Fixed nit Created Feb. 11, 2016, 1:44 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // nsIObserver interface implementation 309 // nsIObserver interface implementation
310 // 310 //
311 _openers: new WeakMap(), 311 _openers: new WeakMap(),
312 312
313 observe: function(subject, topic, data, uri) 313 observe: function(subject, topic, data, uri)
314 { 314 {
315 switch (topic) 315 switch (topic)
316 { 316 {
317 case "content-document-global-created": 317 case "content-document-global-created":
318 { 318 {
319 var opener = this._openers.get(subject); 319 let opener = this._openers.get(subject);
320 if (!opener || Components.utils.isDeadWrapper(opener)) 320 if (opener && Components.utils.isDeadWrapper(opener))
321 opener = null;
322
323 if (!opener)
321 { 324 {
322 // We don't know the opener for this window yet, try to find it 325 // We don't know the opener for this window yet, try to find it
323 if (subject instanceof Ci.nsIDOMWindow) 326 if (subject instanceof Ci.nsIDOMWindow)
324 opener = subject.opener; 327 opener = subject.opener;
325 328
326 if (!opener) 329 if (!opener)
327 return; 330 return;
328 331
329 // The opener might be an intermediate window, get the real one 332 // The opener might be an intermediate window, get the real one
330 while (opener.location == "about:blank" && opener.opener) 333 while (opener.location == "about:blank" && opener.opener)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 let property = (hasCols ? "cols" : "rows"); 480 let property = (hasCols ? "cols" : "rows");
478 let weights = parentNode[property].split(","); 481 let weights = parentNode[property].split(",");
479 weights[index] = "0"; 482 weights[index] = "0";
480 parentNode[property] = weights.join(","); 483 parentNode[property] = weights.join(",");
481 } 484 }
482 } 485 }
483 else 486 else
484 node.classList.add(collapsedClass); 487 node.classList.add(collapsedClass);
485 } 488 }
486 } 489 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld