| Index: src/org/adblockplus/android/AdblockPlus.java |
| diff --git a/src/org/adblockplus/android/AdblockPlus.java b/src/org/adblockplus/android/AdblockPlus.java |
| index eb44cc168d2cfc52197f283f200d1f8a151ef807..700e7be8995811aaeca9816d4b29919fb179efd0 100755 |
| --- a/src/org/adblockplus/android/AdblockPlus.java |
| +++ b/src/org/adblockplus/android/AdblockPlus.java |
| @@ -274,22 +274,30 @@ public class AdblockPlus extends Application |
| * @param domain The domain |
| * @return A list of CSS selectors |
| */ |
| - public String[] getSelectorsForDomain(final String domain) |
| + public String[] getSelectorsForDomain(final String url, String referrer) |
| { |
| - /* We need to ignore element hiding rules here to work around two bugs: |
| - * 1. CSS is being injected even when there's an exception rule with $elemhide |
| - * 2. The injected CSS causes blank pages in Chrome for Android |
| - * |
| - * Starting with 1.1.2, we ignored element hiding rules after download anyway, to keep the |
| - * memory usage down. Doing this with libadblockplus is trickier, but would be the clean |
| - * solution. */ |
| - return null; |
| -/* |
| - if (!filteringEnabled) |
| + if (this.abpEngine.isElemhideEnabled() && this.filteringEnabled) |
| + { |
| + if (referrer != null) |
| + { |
| + this.referrerMapping.add(url, referrer); |
| + } |
| + final List<String> referrerChain = this.referrerMapping.buildReferrerChain(referrer); |
| + final String[] referrerChainArray = referrerChain.toArray(new String[referrerChain.size()]); |
| + final List<String> selectors = this.abpEngine.getElementHidingSelectors(url, referrerChainArray); |
| + return selectors.toArray(new String[selectors.size()]); |
| + } |
| + else |
| + { |
| + /* We need to ignore element hiding rules here to work around two bugs: |
| + * 1. CSS is being injected even when there's an exception rule with $elemhide |
| + * 2. The injected CSS causes blank pages in Chrome for Android |
| + * |
| + * Starting with 1.1.2, we ignored element hiding rules after download anyway, to keep the |
| + * memory usage down. Doing this with libadblockplus is trickier, but would be the clean |
| + * solution. */ |
| return null; |
| - |
| - return abpEngine.getSelectorsForDomain(domain); |
| -*/ |
| + } |
| } |
| /** |