Index: mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java |
=================================================================== |
--- a/mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java |
+++ b/mobile/android/thirdparty/org/adblockplus/browser/AddOnBridge.java |
@@ -363,33 +363,42 @@ public class AddOnBridge |
final String url) |
{ |
Log.d(TAG, "queryIsLocal for " + url); |
final Map<String, Object> parameters = new HashMap<String, Object>(); |
parameters.put("url", url); |
callFunction(callback, "isLocal", parameters); |
} |
- public static void queryIsPageWhitelisted(final AdblockPlusApiCallback callback, |
- final String url) |
+ public static void queryWhitelistedWebsites(final AdblockPlusApiCallback callback) |
{ |
- Log.d(TAG, "queryIsPageWhitelisted for " + url); |
- final Map<String, Object> parameters = new HashMap<String, Object>(); |
- parameters.put("url", url); |
- callFunction(callback, "isPageWhitelisted", parameters); |
+ Log.d(TAG, "queryWhitelistedWebsites"); |
+ final Map<String, Object> parameters = new HashMap<>(); |
+ callFunction(callback, "getWhitelistedWebsites", parameters); |
} |
- public static void whitelistSite(final AdblockPlusApiCallback callback, final String url, |
+ public static void queryIsWebsiteWhitelisted(final AdblockPlusApiCallback callback, |
+ final String url) |
+ { |
+ Log.d(TAG, "queryIsWebsiteWhitelisted for " + url); |
+ final Map<String, Object> parameters = new HashMap<String, Object>(); |
+ parameters.put("url", url); |
+ parameters.put("host", UrlUtils.getHostFromUrl(url)); |
+ callFunction(callback, "isWebsiteWhitelisted", parameters); |
+ } |
+ |
+ public static void whitelistWebsite(final AdblockPlusApiCallback callback, String url, |
final boolean whitelisted) |
{ |
- Log.d(TAG, "whitelistSite for " + url); |
+ Log.d(TAG, "whitelistWebsite for " + url); |
final Map<String, Object> parameters = new HashMap<String, Object>(); |
- parameters.put("url", url); |
+ parameters.put("url", UrlUtils.formatUrl(url)); |
+ parameters.put("host", UrlUtils.getHostFromUrl(url)); |
parameters.put("whitelisted", whitelisted); |
- callFunction(callback, "whitelistSite", parameters, true); |
+ callFunction(callback, "whitelistWebsite", parameters, true); |
} |
private static class AddOnRequest extends GeckoRequest |
{ |
private final JSONObject value; |
private final AdblockPlusApiCallback apiCallback; |
AddOnRequest(final JSONObject value, final AdblockPlusApiCallback callback) |