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

Side by Side Diff: lib/contentPolicy.js

Issue 29329399: Issue 3208 - Remove the bug 467514 work-around (link clicks in frames) (Closed)
Patch Set: Created Oct. 26, 2015, 8:15 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 | « 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-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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 { 544 {
545 newLocation = newChannel.URI; 545 newLocation = newChannel.URI;
546 } catch(e2) {} 546 } catch(e2) {}
547 if (!newLocation) 547 if (!newLocation)
548 return; 548 return;
549 549
550 let wnd = Utils.getRequestWindow(newChannel); 550 let wnd = Utils.getRequestWindow(newChannel);
551 if (!wnd) 551 if (!wnd)
552 return; 552 return;
553 553
554 if (contentType == Policy.type.SUBDOCUMENT && wnd.parent == wnd.top && wnd .opener)
555 {
556 // This is a window opened in a new tab miscategorized as frame load,
557 // see bug 467514. Get the frame as context to be at least consistent.
558 wnd = wnd.opener;
559 }
560
561 if (contentType == Policy.type.POPUP && wnd.opener) 554 if (contentType == Policy.type.POPUP && wnd.opener)
562 { 555 {
563 // Popups are initiated by their opener, not their own window. 556 // Popups are initiated by their opener, not their own window.
564 wnd = wnd.opener; 557 wnd = wnd.opener;
565 } 558 }
566 559
567 if (!Policy.processNode(wnd, wnd.document, contentType, newLocation, false )) 560 if (!Policy.processNode(wnd, wnd.document, contentType, newLocation, false ))
568 result = Cr.NS_BINDING_ABORTED; 561 result = Cr.NS_BINDING_ABORTED;
569 } 562 }
570 catch (e) 563 catch (e)
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 if (!wnd || wnd.closed) 769 if (!wnd || wnd.closed)
777 return; 770 return;
778 771
779 if (entry.type == Policy.type.OBJECT) 772 if (entry.type == Policy.type.OBJECT)
780 { 773 {
781 node.removeEventListener("mouseover", objectMouseEventHander, true); 774 node.removeEventListener("mouseover", objectMouseEventHander, true);
782 node.removeEventListener("mouseout", objectMouseEventHander, true); 775 node.removeEventListener("mouseout", objectMouseEventHander, true);
783 } 776 }
784 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true) ; 777 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true) ;
785 } 778 }
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