Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SchemeSupported to the OpenURI portal #1203

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xhorak
Copy link
Contributor

@xhorak xhorak commented Nov 16, 2023

To check whenever specific scheme is supported by the host.

@grulja
Copy link
Contributor

grulja commented Jan 16, 2024

I think this change as it is, is a bit incomplete. If an app/client is supposed to call this API, it needs to be added to the org.freedesktop.portal.OpenURI instead, because your addition is what backend implementations (xdp-kde/xdp-gnome) are supposed to implement, but these APIs are not called directly by clients and possibly not even visible outside the sandbox by default. With an additional API, you should also bump a version of the org.freedesktop.portal.OpenURI so clients can check whether the version of xdp that is running on the host supports it. I'm not sure a backend counterpart is needed as you can probably tell the host can handle given scheme using the g_app_* APIs (I'm not an expert in this regard). That would mean that also the implementation of this additional API is missing in this MR.

tests/test-portals.c Show resolved Hide resolved
src/open-uri.c Outdated Show resolved Hide resolved
@grulja
Copy link
Contributor

grulja commented Jan 23, 2024

@xhorak also please squash your commits or split it to reasonable parts and remove the merge commit.

@xhorak xhorak reopened this Jan 23, 2024
@xhorak xhorak changed the title Add SchemeSupported to the AppChooser Add SchemeSupported to the OpenURI portal Jan 31, 2024
@xhorak
Copy link
Contributor Author

xhorak commented Jan 31, 2024

@matthiasclasen Could you please check this one?

@grulja
Copy link
Contributor

grulja commented Jun 10, 2024

This needs a rebase.

Also, see #1375. You will have to bump version to 5. Also at the top of the XML file there is a sentence This document describes interface in version 4 which needs to be updated too.

I also wonder whether this shouldn't be more generic, e.g. looking at #1313, this will make OpenURI to handle more than schemes. Maybe something like having URISupported which is probably a terrible name, but just to give you the sense what I mean.

Also, OpenURI gives you an option to install an app that can possible handle the requested scheme if there is none on the system. With your SchemeSupported call, you will end up making Firefox to handle it itself, because you don't get to call the OpenURI. Just mentioning this as something to think about as I don't have a solution to this.

@grulja
Copy link
Contributor

grulja commented Jun 10, 2024

Also, maybe this can be permission based? To address @matthiasclasen concerns?

Like, first ask will popup a permission dialog, to ask whether you want to allow given application access to this information, store it for this app (app_id) and have all the following ones without any permission dialog needed in case the permission has been granted already?

That would mean using the generic Access portal for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants