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

Side by Side Diff: lib/contentPolicy.js

Issue 9046035: Removed Do-Not-Track handling (Closed)
Patch Set: Created Dec. 18, 2012, 2:06 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 | lib/matcher.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 the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 this.expectingPopupLoad = false; 471 this.expectingPopupLoad = false;
472 }); 472 });
473 } 473 }
474 break; 474 break;
475 } 475 }
476 case "http-on-modify-request": 476 case "http-on-modify-request":
477 { 477 {
478 if (!(subject instanceof Ci.nsIHttpChannel)) 478 if (!(subject instanceof Ci.nsIHttpChannel))
479 return; 479 return;
480 480
481 if (Prefs.enabled)
482 {
483 let match = defaultMatcher.matchesAny(subject.URI.spec, "DONOTTRACK", null, false);
484 if (match && match instanceof BlockingFilter)
485 {
486 FilterStorage.increaseHitCount(match);
487 subject.setRequestHeader("DNT", "1", false);
488
489 // Bug 23845 - Some routers are broken and cannot handle DNT header
490 // following Connection header. Make sure Connection header is last.
491 try
492 {
493 let connection = subject.getRequestHeader("Connection");
494 subject.setRequestHeader("Connection", null, false);
495 subject.setRequestHeader("Connection", connection, false);
496 } catch(e) {}
497 }
498 }
499
500 if (this.previousRequest && subject.URI == this.previousRequest[0] && 481 if (this.previousRequest && subject.URI == this.previousRequest[0] &&
501 subject instanceof Ci.nsIWritablePropertyBag) 482 subject instanceof Ci.nsIWritablePropertyBag)
502 { 483 {
503 // We just handled a content policy call for this request - associate 484 // We just handled a content policy call for this request - associate
504 // the data with the channel so that we can find it in case of a redir ect. 485 // the data with the channel so that we can find it in case of a redir ect.
505 subject.setProperty("abpRequestType", this.previousRequest[1]); 486 subject.setProperty("abpRequestType", this.previousRequest[1]);
506 this.previousRequest = null; 487 this.previousRequest = null;
507 } 488 }
508 489
509 if (this.expectingPopupLoad) 490 if (this.expectingPopupLoad)
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 if (!wnd || wnd.closed) 713 if (!wnd || wnd.closed)
733 return; 714 return;
734 715
735 if (entry.type == Policy.type.OBJECT) 716 if (entry.type == Policy.type.OBJECT)
736 { 717 {
737 node.removeEventListener("mouseover", objectMouseEventHander, true); 718 node.removeEventListener("mouseover", objectMouseEventHander, true);
738 node.removeEventListener("mouseout", objectMouseEventHander, true); 719 node.removeEventListener("mouseout", objectMouseEventHander, true);
739 } 720 }
740 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true) ; 721 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true) ;
741 } 722 }
OLDNEW
« no previous file with comments | « no previous file | lib/matcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld