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

Side by Side Diff: assets/js/start.js

Issue 8851049: ABP/Android Domain specific filters (Closed)
Patch Set: Created Nov. 15, 2012, 7:38 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 | res/values/bools.xml » ('j') | res/values/bools.xml » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This Source Code is subject to the terms of the Mozilla Public License 2 * This Source Code is subject to the terms of the Mozilla Public License
3 * version 2.0 (the "License"). You can obtain a copy of the License at 3 * version 2.0 (the "License"). You can obtain a copy of the License at
4 * http://mozilla.org/MPL/2.0/. 4 * http://mozilla.org/MPL/2.0/.
5 */ 5 */
6 6
7 function removeTrailingDots(string) 7 function removeTrailingDots(string)
8 { 8 {
9 return string.replace(/\.+$/, ""); 9 return string.replace(/\.+$/, "");
10 } 10 }
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 contentType = "STYLESHEET"; 552 contentType = "STYLESHEET";
553 else if (/\.(?:gif|png|jpe?g|bmp|ico)$/.test(lurl)) 553 else if (/\.(?:gif|png|jpe?g|bmp|ico)$/.test(lurl))
554 contentType = "IMAGE"; 554 contentType = "IMAGE";
555 else if (/\.(?:ttf|woff)$/.test(lurl)) 555 else if (/\.(?:ttf|woff)$/.test(lurl))
556 contentType = "FONT"; 556 contentType = "FONT";
557 } 557 }
558 if (contentType == null) 558 if (contentType == null)
559 contentType = "OTHER"; 559 contentType = "OTHER";
560 560
561 if (refHost != "") 561 if (refHost != "")
562 {
563 thirdParty = isThirdParty(reqHost, refHost); 562 thirdParty = isThirdParty(reqHost, refHost);
564 }
565 563
566 if (query != "") 564 if (query != "")
567 url = url + "?" + query; 565 url = url + "?" + query;
568 566
569 var filter = defaultMatcher.matchesAny(url, contentType, null, thirdParty); 567 var filter = defaultMatcher.matchesAny(url, contentType, null, thirdParty);
570 568
569 // hack: if there is no referrer block only if filter is domain-specific
570 // (to re-enable in-app ads blocking, proposed on 12.11.2012 Monday meeting)
571 if (filter != null && refHost == "" && filter.text.indexOf("||") != 0)
572 filter = null;
573
571 return (filter != null && !(filter instanceof WhitelistFilter)); 574 return (filter != null && !(filter instanceof WhitelistFilter));
572 } 575 }
573 576
574 Android.load("XMLHttpRequest.jsm"); 577 Android.load("XMLHttpRequest.jsm");
575 Android.load("FilterNotifier.jsm"); 578 Android.load("FilterNotifier.jsm");
576 Android.load("FilterClasses.jsm"); 579 Android.load("FilterClasses.jsm");
577 Android.load("SubscriptionClasses.jsm"); 580 Android.load("SubscriptionClasses.jsm");
578 Android.load("FilterStorage.jsm"); 581 Android.load("FilterStorage.jsm");
579 Android.load("FilterListener.jsm"); 582 Android.load("FilterListener.jsm");
580 Android.load("Matcher.jsm"); 583 Android.load("Matcher.jsm");
581 Android.load("ElemHide.jsm"); 584 Android.load("ElemHide.jsm");
582 Android.load("Synchronizer.jsm"); 585 Android.load("Synchronizer.jsm");
583 586
584 FilterListener.startup(); 587 FilterListener.startup();
585 Synchronizer.startup(); 588 Synchronizer.startup();
586 589
587 Android.load("publicSuffixList.js"); 590 Android.load("publicSuffixList.js");
588 Android.load("punycode.js"); 591 Android.load("punycode.js");
589 Android.load("basedomain.js"); 592 Android.load("basedomain.js");
OLDNEW
« no previous file with comments | « no previous file | res/values/bools.xml » ('j') | res/values/bools.xml » ('J')

Powered by Google App Engine
This is Rietveld