Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

[Firefox] chrome and about url wrongly identified #284

Closed
quilloss opened this issue Jul 6, 2015 · 5 comments
Closed

[Firefox] chrome and about url wrongly identified #284

quilloss opened this issue Jul 6, 2015 · 5 comments

Comments

@quilloss
Copy link

quilloss commented Jul 6, 2015

uMatrix 0.9.1.3-dev.2
Firefox 40.0b1

Several chrome and about url are identified by uMatrix as blank.about-scheme.
For example about:addons and chrome://ublock0/content/dashboard.html.
It might apply for all urls of those schemes.
uMatrix 0.9.1.2 works fine.

@0xBRM
Copy link

0xBRM commented Jul 6, 2015

All about:* URLs are a part of blank.about-scheme. As for uBlock's dashboard, it's a background page, so it makes sense. If you want to look at the b-t-s requests, you're going to have to open it in its own dashboard.

Edit: was trying to replicate it (successfully, which is the expected behaviour) and found an actual bug.

Steps to reproduce:

  1. Go to ANY page https://github.com/
  2. Go to about:about
  3. Check the matrix

What happens: uMatrix is still stuck on github's page
Expected behaviour: blank.about-scheme

Works for some other about: pages as well, like about:cache.

@quilloss
Copy link
Author

quilloss commented Jul 6, 2015

I would expect about:addons to result in addons.about-scheme and chrome://ublock0/content/dashboard.html to result in ublock0.chrome-scheme.
At least if I go by uMatrix 0.9.1.2 behavior.

Also https://github.com/gorhill/uMatrix/blob/master/src/js/tab.js#L72-L78

    var fakeHostname = scheme + '-scheme';

    if ( uri.hostname !== '' ) {
        fakeHostname = uri.hostname + '.' + fakeHostname;
    } else if ( scheme === 'about' ) {
        fakeHostname = uri.path + '.' + fakeHostname;
    }

@gorhill
Copy link
Owner

gorhill commented Jul 6, 2015

I would expect about:addons to result in addons.about-scheme and chrome://ublock0/content/dashboard.html to result in ublock0.chrome-scheme.

Yes, it's supposed to be like this for about:[...] pages, but for chrome://ublock0/[...] pages it links to the behind-the-scene scope because it used to be the only way to do it. This could be removed now that the behind-the-scene scope is available in the logger.

Regarding that about:[...] scheme, it seems it's again #262, which for whatever incredibly annoying reason, I just can't reproduce on my side.

@quilloss
Copy link
Author

Could the issue be due to the changes for tabWatcher in d6a48df.

uMatrix 0.9.1.2
When navigating from about:blank to https://github.com/gorhill/uMatrix, 2 calls to TabContext.update is made. The call stack shows that the first came from httpObserver.observe and the second from tabWatcher.onLocationChange.

When navigating from about:blank to about:memory only the call originating from tabWatcher.onLocationChange is present.

uMatrix 0.9.1.3-dev.3
tabWatcher.onLocationChange is no longer there.
Navigating from about:blank to about:memory results in no call to TabContext.update.
Basically any navigation to an about:[...] will result in no call to TabContext.update.

@gorhill
Copy link
Owner

gorhill commented Jul 17, 2015

@quilloss Thanks for the investigation, this put me on the right track.

The real issue is not found in d6a48df, but rather in 4ab8f52: I should not have removed @AlexVallat's content-side code to deal with location changes. Even though this seems like this worked, I just found easy case to reproduce issues where the current way of dealing with URL change in the address bar does not work in uMatrix, even if I were to put back the code removed in d6a48df. The test is very simple:

  • Type directly about:memory in the address bar, hit return.
  • uMatrix is not aware of the location change.
  • Type directly news.ycombinator.com in the address bar.
  • uMatrix is aware of the location change.
  • Type directly about:memory in the address bar.
  • uMatrix is not aware of the location change.

So the real fix is to bring back the code removed in 4ab8f52. I did not realize back then that it was just not possible to reliably track location change without this code.

Noxgrim pushed a commit to Noxgrim/uMatrix that referenced this issue Dec 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants