GNOME Bugzilla – Bug 787849
flatpak: Can't view page source
Last modified: 2017-12-04 17:33:22 UTC
When I click "Page Source", it duplicates current tab instead. No output in console or errors. Runtime: org.gnome.Platform//3.26
It's supposed to open in the default text editor. Is it possible that the default text editor is Epiphany inside the flatpak environment? I bet it is. Try something like this to test: $ flatpak run org.gnome.Epiphany --command /bin/bash $ xdg-mime query default text/plain I have no clue how that could be expected to work inside flatpak, unfortunately, since gedit is not going to be inside the runtime. The real solution is probably to get embedded view source working again (see the wip/view-source branch).
See also https://bugzilla.gnome.org/show_bug.cgi?id=787850, it's pretty much the same thing, except it can't be worked around like this
xdg-mime: Command not found
In window_cmd_page_source() and save_temp_source_close_cb(), try replacing the calls to ephy_file_launch_handler() with g_app_info_launch_default_for_uri() so that it uses flatpak's open-uri portal.
(In reply to Michael Catanzaro from comment #4) > In window_cmd_page_source() and save_temp_source_close_cb(), try replacing > the calls to ephy_file_launch_handler() with > g_app_info_launch_default_for_uri() so that it uses flatpak's open-uri > portal. This is hard. The portal won't work, because we'll never get to the portal, because Ephy can always open the file itself, and so it will always be chosen as the default app. I don't think this is fixable without using the portal D-Bus API directly.
Best solution is probably to restore the in-browser view source handler... even if there's no syntax highlighting. See the wip/view-source branch.
The following fix has been pushed: 5d7e827 flatpak: Implement view page source
Created attachment 364936 [details] [review] flatpak: Implement view page source This was way too hard! We really need to reimplement in-browser view source mode. But we have always supported external view source mode, using the default text/plain handler, via a hidden GSetting. So even once we restore in-browser view source, we will still want to keep this code around. We have to use the portal D-Bus API manually because the only way to get it using GLib is to use g_app_info_launch_default_for_uri(), and that will always pick Epiphany itself as the default handler, because Epiphany supports opening HTML files. The portal is only accessible via a fallback path.