Skip to content

Loading…

[Firefox Mobile/Fennec] HTTPS Everywhere and uBlock working intermittently #1149

Closed
droidery opened this Issue · 21 comments

6 participants

@droidery

When uBlock is used in combination with HTTPS Everywhere in Firefox for Android, uBlock sometimes fails to load.

Tested configurations

I have reproduced the issue on two different Android devices running different versions of the OS (an older version of Android and the latest release).

Browser: Firefox 37 (Fennec)
OS: Android 5.0.2 and Android 4.4.4
Only extensions installed:

  • HTTPS Everywhere 5.0.1
  • uBlock 0.9.2.4-dev.4 and 0.9.2.3 (settings are default)

Sometimes uBlock does not load at all in browser sessions, but sometimes its loads.

Steps to reproduce

  1. Open http://www.theguardian.com/ or http://www.theguardian.com/world
  2. Tap Settings > Add to Home Screen
  3. Open Guardian webpage via home screen
  4. [Observe if uBlock loaded]
  5. Go the Android overview and kill the Firefox for clean Firefox session

Going through steps 1 - 5 multiple times you should be able to notice uBlock only loading in some instances.

Also in everyday browsing uBlock just does not start properly when combined with HTTPS Everywhere in Firefox for Android, though using steps 1 - 5 is the easiest way to test multiple Firefox sessions with a single webpage.

Screenshots

2
Advertisement loaded (In the browser sessions where HTTPS Everywhere loads successfully but uBlock does not). NOTE: HTTPS Everywhere extension always loads but uBlock does not always load

3

Advertisement not loaded (In the browser sessions where both HTTPS Everywhere and uBlock load successfully)

1

In cases where ads are loaded (when uBlock fails to load properly but HTTPS Everywhere loads) uBlock has a settings page that looks like this (notice no labels)

@droidery droidery changed the title from HTTPS Everywhere and uBlock intermittently to HTTPS Everywhere and uBlock working intermittently
@gorhill gorhill added the available label
@chrisaljoudi chrisaljoudi changed the title from HTTPS Everywhere and uBlock working intermittently to [Firefox Mobile/Fennec] HTTPS Everywhere and uBlock working intermittently
@AlexVallat
Collaborator

I haven't been able to reproduce this, can you also test to see if you ever encounter the issue without HTTPS Everywhere installed, if you have not done so already? Does it make any difference if the HTTPS Everywhere Rule for theguardian.com is enabled or not?

@droidery

@AlexVallat Thank you for looking into this issue.

I have run a bunch of 'tests' using the steps I posted earlier to answer your questions.

When HTTPS Everywhere is not installed, uBlock works perfectly.

When HTTPS Everywhere is installed, uBlock only loads around 1/5 of the time.

When HTTPS Everywhere is installed (with HTTPS rules disabled for the website), uBlock still fails to load.

When HTTPS Everywhere is installed and a different adblocking extension is used (e.g. Bluhell Firewall), both extensions work perfectly.

EDIT:
Tried more configurations:

  • Tested the Mozilla Blog by adding to homescreen and running tests, issue persists. uBlock still only sometimes loads.
  • Tested Firefox 38 Beta for Mobile, issue persists

@AlexVallat Did you try reproducing on the latest stable Firefox (version 37) and HTTPS Everywhere?

@droidery

Do you know of anyway I can log error messages to find what could be causing uBlock to not start properly?

@AlexVallat
Collaborator

Fennec will log to logcat, so you can use a viewer like CatLog and set the filter to "GeckoConsole".

(If you happen to have the android SDK installed on a PC and know how to connect your device using adb, then I find it more convenient to use the Web IDE in Firefox (under Developer menu) and connect through that - the device just shows up in the list automatically and the logs are displayed since Fennec startup.)

@droidery

Thanks Alex.

I created a log at https://gist.github.com/droidery/426500d6b02126d84fe7. I replaced some information with XXXXXX as I was unsure if it was private data or not.

The errors I could pick up related to uBlock are:
1) When first opening browser

04-02 21:20:28.402    XXXX-XXXX/? W/GeckoConsole﹕ [JavaScript Error: "TypeError: hiddenDoc.documentElement is null" {file: "resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///data/data/org.mozilla.firefox/files/mozilla/XXXXXX.default/extensions/%XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX%7D.xpi!/bootstrap.js" line: 63}]

2) When trying to open uBlock settings page (like in screenshot 3 in my first page) after uBlock fails to load

04-02 21:22:12.420    XXXX-XXXX/? I/GeckoConsole﹕ XXXXXXX addons.xpi  WARN    Exception running bootstrap method shutdown on {XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX}: TypeError: bgProcess is undefined (resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///data/data/org.mozilla.firefox/files/mozilla/XXXXXX.default/extensions/%XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX.xpi!/bootstrap.js:110:4) JS Stack trace: shutdown@bootstrap.js:110:5 < XPI_callBootstrapMethod@XPIProvider.jsm:631:21 < XPI_updateAddonDisabledState@XPIProvider.jsm:649:166 < AddonWrapper_userDisabledSetter@XPIProvider.jsm:945:6 < setEnabled@aboutAddons.js:37:111 < disable@aboutAddons.js:43:115 < _sendMouseEvent@browser.js:529:577 < BrowserEventHandler.handleUserEvent@browser.js:513:118 < BrowserEventHandler.observe@browser.js:498:52
@droidery

I updated to the new 0.9.3.0 release and this issue seems to have gone.

@droidery droidery closed this
@AlexVallat
Collaborator

That's good news, thanks for letting us know, and thanks for the logs. The first error you mention was the relevant one, the second one is simply a side-effect of the first. If it starts happening again, that's where to investigate from.

@droidery

@AlexVallat The issue started happening again just then (I tested it again after I saw your comment).

I'll reopen this to see if anyone else is having the same problem. I can reproduce on both my Android devices so perhaps someone can shed more light on what the bug is ...

@droidery droidery reopened this
@AlexVallat
Collaborator

Well that's irritating. If you figure out anything about what makes it start and stop happening like that, do let me know!

@desbma

I'm having the same problem (uBlock not blocking ads + button glitch):
button glitch versions about:support

Disabling and re-enabling uBlock makes it work again.

@AlexVallat
Collaborator

The buttons thing is a side effect - if uBlock fails to load, it won't have set the text on the buttons (and of course won't block ads, or appear on the menu). The question is, why is uBlock failing to load? - if you are able to check the log messages in the same way as @droidery then it would be very useful to know if you see the same W/GeckoConsole﹕ [JavaScript Error: "TypeError: hiddenDoc.documentElement is null" error.

I have an idea on a way to work around this, but without being able to reproduce the issue myself I can't test it.

@desbma

I have updated to uBlock 0.9.3.0 and HTTPS Everywhere 5.0.1, and will look at the logs next time I reproduce.

@desbma

I hit the problem today, and this line is in the logs:
04-05 17:29:25.374 W/GeckoConsole(2244): [JavaScript Error: "TypeError: hiddenDoc.documentElement is null" {file: "resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///data/data/org.mozilla.firefox/files/mozilla/ptqt1zy7.default/extensions/%7B2b10c1c8-a11f-4bad-fe9c-1c11e82cac42%7D.xpi!/bootstrap.js" line: 63}]

@AlexVallat AlexVallat added a commit to AlexVallat/uBlock that referenced this issue
@AlexVallat AlexVallat Test-fix for #1149 e762a29
@AlexVallat
Collaborator

Thanks for letting me know. So, it looks like it is the same issue then.

If either of you would be willing to try out this test build: https://github.com/AlexVallat/uBlock/releases/tag/0.9.3.0-dev-av.1 that would be really helpful. I would like to know, firstly, whether the problem still occurs, and secondly, please take another look at the logs immediately after starting. As well as the hiddenDoc.documentElement is null message (if it failed to load) I'm also looking for lines like:

uBlock> onReady
uBlock> removing event listener [...]
uBlock> hiddenDOMWindow not ready, waiting

They might appear more than once. In particular, the "not ready, waiting" one will appear if the error would have occurred, but has been prevented by this fix, so that's a good one to see (unless it then goes on to fail anyway, of course, which is always a possibility!)

@desbma

Thanks, I have installed your build, will report with the logs next time I reproduce.

@droidery

@AlexVallat Thanks so much for that.

I tried out the test build and it looks like you have fixed the issue. :smile:

Here are the logs:

04-06 07:40:36.820 I/GeckoConsole(8658): Could not read chrome manifest 'file:///data/data/org.mozilla.firefox/chrome.manifest'.
04-06 07:40:40.090 I/GeckoConsole(8658): uBlock> onReady
04-06 07:40:40.100 I/GeckoConsole(8658): uBlock> removing event listener DOMContentLoaded from [object ChromeWindow]
04-06 07:40:40.100 I/GeckoConsole(8658): uBlock> hiddenDOMWindow not ready, waiting
04-06 07:40:40.620 I/GeckoConsole(8658): OpenGL compositor Initialized Succesfully.
04-06 07:40:40.620 I/GeckoConsole(8658): Version: OpenGL ES 2.0
04-06 07:40:40.620 I/GeckoConsole(8658): Vendor: NVIDIA Corporation
04-06 07:40:40.620 I/GeckoConsole(8658): Renderer: NVIDIA Tegra
04-06 07:40:40.620 I/GeckoConsole(8658): FBO Texture Target: TEXTURE_2D
04-06 07:40:40.640 I/GeckoConsole(8658): Adding HealthReport:RequestSnapshot observer.
04-06 07:40:40.660 I/GeckoConsole(8658): uBlock> onReady
04-06 07:40:40.660 I/GeckoConsole(8658): uBlock> removing event listener DOMContentLoaded from [object HTMLDocument]
04-06 07:40:40.950 I/GeckoConsole(8658): HTTPS Everywhere WARN: Initializing Firefox for Android UI
04-06 07:40:40.950 W/GeckoConsole(8658): [JavaScript Error: "NativeWindow.pageactions is deprecated. Please use resource://gre/modules/PageActions.jsm instead" {file: "chrome://browser/content/browser.js" line: 235}]
04-06 07:40:41.030 W/GeckoConsole(8658): [JavaScript Warning: "window.controllers is deprecated. Do not use it for UA detection." {file: "chrome://browser/content/browser.js" line: 274}]
04-06 07:40:41.060 I/GeckoConsole(8658): HTTPS Everywhere WARN: getBrowserForChannel: mTab was null for http://example.com/
@AlexVallat
Collaborator

Excellent, that log snippet is exactly what I was hoping for. Timing issues like these are always difficult to pin down.

@AlexVallat AlexVallat referenced this issue
Merged

Fixing #1149 #1195

@tancrackers

I can also confirm this on Firefox 37.0.1 on Android 5.1.0, Nexus 5.
I didn't even make the connection between https-everywhere and ublock, but there were the only extensions I had installed.
I noticed, specifically, that when Firefox on Android is closed as a background process, that ublock does not automatically load back up when I reopen Firefox. This is while https-everywhere is enabled too. However, https-everywhere loads just fine.

@droidery

@tancrackers Did you try @AlexVallat's build to check if it resolves the issue for you as well?

@AlexVallat AlexVallat closed this
@tancrackers

I downloaded the fix build, and I can confirm that the bug is fixed on my end :+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.