xdgmime update breaks webkit2gtk file:// requests
I don't know much about glib or webkit2gtk so this is going to be a bit broad. The investigation originates from https://github.com/johnfactotum/foliate/issues/878 where it was found that:
- on some systems (reproducers have been found on at least Arch, Debian, and Fedora, but other users on those distributions cannot reproduce it),
- with glib 2.72.0 installed (also repros on 2.71.0, 2.71.1, 2.71.2, 2.71.3, and 2.72.1),
- webkit2gtk requests to
file://
URLs will return a cross-origin error message, - even though the requests are using webkit2gtk's
allow_universal_access_from_file_urls
argument which is supposed to allow all requests regardless of origin
A reproducer can be found on the aforementioned issue (https://github.com/johnfactotum/foliate/issues/878#issuecomment-1077461112). It requires gjs and webkit2gtk (a smaller reproducer can probably be made with just webkit2gtk, but this is beyond my expertise). Notably the issue is not caused by webkit2gtk changes. Hopefully this matrix is illustrative:
glib 2.70.4 | glib 2.72.0 | |
---|---|---|
webkit2gtk 2.34.6 | works | bugged |
webkit2gtk 2.36.0 | works | bugged |
Git bisection shows that the bug was introduced by !2029 (merged) 60173d0a and at this point I'm kind of stuck. I don't know enough about either of these projects to understand how this change could possibly have this effect, all I know for sure is my epub reader reliably breaks when I build glib with this change and reliably works when I build glib without it. I'm happy to contribute more to the investigation (testing patches, fiddling with my local mime database, etc) since I'm already in this deep, but maintainers will have to tell me what to try next.