Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

"TypeError: this.userSettings is undefined"; Pages not loading. #264

Closed
8 of 9 tasks
chadjoan opened this issue Jun 1, 2020 · 5 comments
Closed
8 of 9 tasks

"TypeError: this.userSettings is undefined"; Pages not loading. #264

chadjoan opened this issue Jun 1, 2020 · 5 comments
Labels
external an external factor is involved Firefox specific to Firefox unable to reproduce cannot reproduce the given issue

Comments

@chadjoan
Copy link

chadjoan commented Jun 1, 2020

Prerequisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
  • This is not a support issue or a question
    • Support issues and questions are handled at /r/uMatrix
  • I tried to reproduce the issue when...
    • uMatrix is the only extension
    • uMatrix with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uMatrix
  • I checked the documentation to understand that the issue I report is not a normal behavior
  • I used the logger to rule out that the issue is caused by my ruleset

Description

Running uMatrix in a debugger launched from about:debugging#/runtime/this-firefox causes it to pause on a TypeError. This might also be preventing all webpages from loading.

A specific URL where the issue occurs

No tabs are open in the session, except the about:debugging and toolbox tabs mentioned below. If this prevents page loading, then it has affected every URL that I have tried that isn't an internal firefox tool/mechanism (ex: "about:" pages).

Steps to Reproduce

  1. Navigate to about:debugging#/runtime/this-firefox
  2. Click "Inspect" next to uMatrix extension.
  3. Firefox opens a toolbox tab ("Toolbox - Extension / uMatrix") and soon displays the error ("TypeError: this.userSettings is undefined") while opening tab.js and highlighting line 612 ("this.userSettings.iconBadgeEnabled &&")
  4. If I continue debugging by hitting "Step over", it runs a few more statements and then halts.

Firefox will also not load any webpages while uMatrix is enabled. It will load continuously but never display any content or time out. While this happens, uMatrix will remain "grey" and shows no blocked or passed actions or resources. Disabling uMatrix allows pages to load (ex: I can navigate to google.com and have it load). I am not absolutely sure that this is caused by the TypeError, but it seems to me like this is a fatal exception of some kind that might prevent subsequent steps (ex: page loads) from executing. If it is, this might be related to issue #241 "Unable to load any website on Firefox".

Ruleset

These are all of my rules:

https-strict: behind-the-scene false
matrix-off: about-scheme true
matrix-off: behind-the-scene true
matrix-off: chrome-extension-scheme true
matrix-off: chrome-scheme true
matrix-off: moz-extension-scheme true
matrix-off: opera-scheme true
matrix-off: vivaldi-scheme true
matrix-off: wyciwyg-scheme true
noscript-spoof: * true
referrer-spoof: * true
referrer-spoof: behind-the-scene false
* * * block
* * css allow
* * frame block
* * image allow
* 1st-party * allow
* 1st-party frame allow

I am facing another (seemingly unrelated) issue where IndexedDB data was lost and backups of it cannot be loaded by extensions (tab-session-manager is also hosed). Whether that's related or not, my uMatrix rules were all lost during the past few days (unless I can find a way to recover them from filesystem backups/snapshots). This gives me the clean-slate that you see, and I figured it would be worth mentioning in case it helps you figure out what caused this (ex: if IDB is used, or indirectly required, to construct that userSettings object).

Supporting evidence

Picture of debugger:
umatrix-usersettings-updatebadge-crushed

Picture of console after execution halts:
umatrix-usersettings-console

Your environment

  • uMatrix version: 1.4.0
  • Browser Name and version: Firefox 76.0.1
  • Operating System and version: Gentoo Linux (Kernel v5.6.7)

Firefox compiled with these USE-flags:
clang gmp-autoupdate hardened hwaccel jack lto screenshot startup-notification system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp wifi

@gorhill
Copy link
Member

gorhill commented Jun 1, 2020

in case it helps you figure out what caused this (ex: if IDB is used, or indirectly required, to construct that userSettings object).

Something is broken on your side in Firefox's extension framework, usersSettings always exists, it's not created dynamically from IDB.

this might be related to issue #241

It's completely unrelated.

@chadjoan
Copy link
Author

chadjoan commented Jun 2, 2020

Thanks, that's good to know.

sigh This is frustrating; I've already recompiled Firefox in addition to profile wiping to get the freshest start possible, and still have problems, so the non-technical heavy-handed approach already failed. I have no idea how to troubleshoot Firefox's extension framework.

I will try to write a bug report for Firefox.

If you have any idea what I could look at to try and figure out my problem or gather info for a Firefox bug report, I'd appreciate any advice.

Thank you for the prompt response and for making this very flexible security software!

@gorhill
Copy link
Member

gorhill commented Jun 2, 2020

Try other similar extensions to see if you also suffer issues. Be sure your storage is working fine, a corrupted profile is known to cause storage issues.

@uBlock-user
Copy link
Contributor

https://firefox-storage-test.glitch.me/

test there, post results here.

@uBlock-user uBlock-user added external an external factor is involved Firefox specific to Firefox unable to reproduce cannot reproduce the given issue labels Jun 2, 2020
@chadjoan
Copy link
Author

chadjoan commented Jun 3, 2020

I have tested with a fresh profile now. uMatrix works as long as I don't try to restore any of my IDB data from before the data loss happened. I actually ran uMatrix successfully (with default rules) and then restored Tab-Session-Manager's IDB files (not uMatrix's) and after that uMatrix no longer functioned. I can even disable (and IIRC, remove) Tab-Session-Manager and still have a broken extension environment. Only when I delete the storage/default/moz-extension+++... folders for Tab-Session-Manager does Firefox seem to have a sane extensions environment again (and uMatrix works again).

Here is the Tab-Session-Manager bug report where I am trying to figure out how to get my data back:
sienori/Tab-Session-Manager#550

At this point I'm pretty convinced that this is a bug in either Firefox or Tab-Session-Manager. For whatever reason, having (presumably) corrupted IDB files for Tab-Session-Manager can create a broken environment for other, unrelated, extensions (ex: uMatrix). I'm really more inclined to consider it a Firefox bug (at least; maybe it's both), due to the action-at-a-distance and lack of isolation: I would expect that extensions shouldn't be able to affect each other, except by consensual mechanism.

The storage glitch test says things are all good when I run it with a fresh profile and only uMatrix installed:
storage-glitch-test-on-fresh-profile

When I attempt to restore Tab-Session-Manager's IDB files, it goes all pear-shaped:
storage-test-broken-idb

Notably, I can't have uMatrix running when I test it in the broken configuration. At that point, it really doesn't have anything to do with uMatrix. I can't expect uMatrix to work correctly in a broken environment, and storage seems to become broken by factors that aren't uMatrix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external an external factor is involved Firefox specific to Firefox unable to reproduce cannot reproduce the given issue
Projects
None yet
Development

No branches or pull requests

3 participants