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

Delta Between Two Patch Sets: lib/ui.js

Issue 4759471792324608: Issue 1712 - Don't add "Adblock Warning Removal List" subscription on Fennec (Closed)
Left Patch Set: Created Dec. 22, 2014, 12:08 a.m.
Right Patch Set: Created Jan. 6, 2015, 5:24 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Load subscriptions data 152 // Load subscriptions data
153 let request = new XMLHttpRequest(); 153 let request = new XMLHttpRequest();
154 request.mozBackgroundRequest = true; 154 request.mozBackgroundRequest = true;
155 request.open("GET", "chrome://adblockplus/content/ui/subscriptions.xml") ; 155 request.open("GET", "chrome://adblockplus/content/ui/subscriptions.xml") ;
156 request.addEventListener("load", function() 156 request.addEventListener("load", function()
157 { 157 {
158 if (onShutdown.done) 158 if (onShutdown.done)
159 return; 159 return;
160 160
161 let currentSubscription = FilterStorage.subscriptions.filter((subscrip tion) => subscription instanceof DownloadableSubscription && 161 let currentSubscription = FilterStorage.subscriptions.filter((subscrip tion) => subscription instanceof DownloadableSubscription &&
162 subscription.url != Prefs.subscriptions_exceptionsurl); 162 subscription.url != Prefs.subscriptions_exceptionsurl &&
163 subscription.url != Prefs.subscriptions_antiadblockurl);
163 currentSubscription = (currentSubscription.length ? currentSubscriptio n[0] : null); 164 currentSubscription = (currentSubscription.length ? currentSubscriptio n[0] : null);
164 165
165 let subscriptions =request.responseXML.getElementsByTagName("subscript ion"); 166 let subscriptions =request.responseXML.getElementsByTagName("subscript ion");
166 for (let i = 0; i < subscriptions.length; i++) 167 for (let i = 0; i < subscriptions.length; i++)
167 { 168 {
168 let item = subscriptions[i]; 169 let item = subscriptions[i];
169 let url = item.getAttribute("url"); 170 let url = item.getAttribute("url");
170 if (!url) 171 if (!url)
171 continue; 172 continue;
172 173
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 subscription.title = "Allow non-intrusive advertising"; 811 subscription.title = "Allow non-intrusive advertising";
811 FilterStorage.addSubscription(subscription); 812 FilterStorage.addSubscription(subscription);
812 if (subscription instanceof DownloadableSubscription && !subscription.la stDownload) 813 if (subscription instanceof DownloadableSubscription && !subscription.la stDownload)
813 Synchronizer.execute(subscription); 814 Synchronizer.execute(subscription);
814 } 815 }
815 else 816 else
816 addAcceptable = false; 817 addAcceptable = false;
817 } 818 }
818 819
819 // Add "anti-adblock messages" subscription for new users and users updating from old ABP versions 820 // Add "anti-adblock messages" subscription for new users and users updating from old ABP versions
820 if ((Services.vc.compare(prevVersion, "2.5") < 0) && !Utils.isFennec) 821 if (Services.vc.compare(prevVersion, "2.5") < 0)
Wladimir Palant 2015/01/06 13:18:12 I guess there is a misunderstanding here - not add
saroyanm 2015/01/06 16:03:07 Thanks for pointing this out, but don't we also ne
Wladimir Palant 2015/01/06 17:05:21 It is normally being enabled via the opt-in prompt
saroyanm 2015/01/06 17:32:36 The prompt is not showing up on mobile unfortunate
821 { 822 {
822 let subscription = Subscription.fromURL(Prefs.subscriptions_antiadblockurl ); 823 let subscription = Subscription.fromURL(Prefs.subscriptions_antiadblockurl );
823 if (subscription && !(subscription.url in FilterStorage.knownSubscriptions )) 824 if (subscription && !(subscription.url in FilterStorage.knownSubscriptions ))
824 { 825 {
825 subscription.disabled = true; 826 subscription.disabled = true;
826 FilterStorage.addSubscription(subscription); 827 FilterStorage.addSubscription(subscription);
827 if (subscription instanceof DownloadableSubscription && !subscription.la stDownload) 828 if (subscription instanceof DownloadableSubscription && !subscription.la stDownload)
828 Synchronizer.execute(subscription); 829 Synchronizer.execute(subscription);
829 } 830 }
830 } 831 }
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1954 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1954 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1955 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1955 ]; 1956 ];
1956 1957
1957 onShutdown.add(function() 1958 onShutdown.add(function()
1958 { 1959 {
1959 for (let window in UI.applicationWindows) 1960 for (let window in UI.applicationWindows)
1960 if (UI.isBottombarOpen(window)) 1961 if (UI.isBottombarOpen(window))
1961 UI.toggleBottombar(window); 1962 UI.toggleBottombar(window);
1962 }); 1963 });
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