sailfishos / sailfish-browser

Sailfish Browser
https://github.com/sailfishos/sailfish-browser/wiki/Sailfish-Browser-wiki
Mozilla Public License 2.0
305 stars 86 forks source link

JavaScript Error: Unexpected event profile-after-change #1045

Closed llewelld closed 9 months ago

llewelld commented 9 months ago

Running the browser the following error can be seen in the debug output when running with EMBED_CONSOLE=1:

JavaScript Error: "Unexpected event profile-after-change"
    {file: "resource://gre/modules/URLQueryStrippingListService.jsm" line: 224}
llewelld commented 9 months ago

I looked into this error in some detail. The service URLQueryStrippingListService is being initialised by the profile-after-change event. The event is being passed to the observe() method, which doesn't recognise the event and so triggers the error.

This seems odd: why be initialised by an event that's going to cause an error? There is some discussion in the bug report and changesets about the fact that the profile-after-change event isn't triggered for content processes in fission, so maybe this is why?

In other situations where gecko is used there are reports of this error appearing, for example on macOS and Thunderbird. However I don't see any changes to address this in the latest gecko version.

The error doesn't itself seem to cause any problems, just messy log output.

Given all this it looks like it must be a case of one of the following:

  1. Upstream are just ignoring the error.
  2. Different ordering of initialisation causing the error, but it doesn't matter.
  3. Different ordering of initialisation causing the error, an indication of some other real problem.

My feeling is that it's probably a case of 1 or 2 and so have added code to suppress the error, see the following commit: https://github.com/llewelld/gecko-dev-mirror/commit/1fe7c56c7363d093b5eadec73d872340467970b4