Opened on 04/06/2017 at 06:10:22 AM
Closed on 04/06/2017 at 06:25:52 AM
#5111 closed defect (rejected)
imgur.com is not working in AdblockWebView demo app
Reported by: | asmirnov | Assignee: | asmirnov |
---|---|---|---|
Priority: | P4 | Milestone: | |
Module: | Libadblockplus-Android | Keywords: | |
Cc: | fhd, robert, vicky | Blocked By: | |
Blocking: | Platform: | Android | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Environment
While testing for some milestone (March,31) we've found that "imgur.com" can't be shown in AdblockWebView demo app ("m.imgur.com" to be more detailed). Turning Adblock off in the settings did not help. Quick looking into the logs shown that nothing is wrong with AdblockWebView. We need to investigate.
How to reproduce
- Launch AdblockWebView demo app
- navigate to "imgur.com"
- make sure black screen is shown
...
Observed behaviour
Black webpage screen
Expected behaviour
Regular webpage surface (with images).
Attachments (7)
Change History (12)
Changed on 04/06/2017 at 06:11:16 AM by asmirnov
Changed on 04/06/2017 at 06:12:19 AM by asmirnov
logs (adblock is on)
Changed on 04/06/2017 at 06:12:36 AM by asmirnov
logs (adblock is off)
comment:1 Changed on 04/06/2017 at 06:14:29 AM by asmirnov
Checking UserAgent in AdblockWebView:
"User-Agent" -> "Mozilla/5.0 (Linux; Android 5.1.1; Android SDK built for x86 Build/LMY48X) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36"
It's working in desktop browser with the same user agent
comment:2 Changed on 04/06/2017 at 06:15:01 AM by asmirnov
- Ready set
Changed on 04/06/2017 at 06:15:51 AM by asmirnov
user agent
Changed on 04/06/2017 at 06:16:21 AM by asmirnov
working on desktop
comment:3 Changed on 04/06/2017 at 06:19:59 AM by asmirnov
Checking errors in JS log shown that some object is null and it was unexpected - the problem is in "imgur.mobile.lib.min.js" script.
The missing object is window.localStorage.
This can be fixed by settings AdbockWebView setting setDomStorageEnabled(true):
https://developer.android.com/reference/android/webkit/WebSettings.html#setDomStorageEnabled(boolean)
However by default the value if false and imgur script have to check if it's null to work correctly.
Settings the value confirmed it can be shown now (see attachment) and logs.
Changed on 04/06/2017 at 06:21:25 AM by asmirnov
shown with webView.getSettings().setDomStorageEnabled(true);
Changed on 04/06/2017 at 06:22:55 AM by asmirnov
logs with enabled local storage (working)
comment:4 Changed on 04/06/2017 at 06:25:04 AM by asmirnov
However, here are my considerations:
1) imgur should check if window.localStorage is not null
2) this is app logics to enable some settings (as default ones are not suitable for imgur) and i've checked it can be fixed in the app code, not in library code.
So i'd say it's invalid issue for AdblockWebView.
comment:5 Changed on 04/06/2017 at 06:25:52 AM by asmirnov
- Resolution set to rejected
- Status changed from new to closed
black screen