Skip to content

feat(webext): try to determine app_id from native messaging binary environment - #234

Open
michaelbeaumont wants to merge 1 commit into
linux-credentials:mainfrom
michaelbeaumont:feat/webext-desktop-file
Open

michaelbeaumont wants to merge 1 commit into
linux-credentials:mainfrom
michaelbeaumont:feat/webext-desktop-file

Conversation

@michaelbeaumont

Copy link
Copy Markdown
Contributor

Does this make sense? It makes running on systems that don't use org.firefox.mozilla easier, since we're just trusting the APP_ID the client tells us anyway...

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

For my learning purposes, could you submit a log or D-Bus trace (you can use the Bustle app for that) that shows the ID being used on Firefox? It seems curious that the app ID would be different on different distributions since org.mozilla.firefox is perfectly globally unique.

I think this is a good addition, regardless. Added a comment below

Comment on lines +484 to +491
browser_pid = os.getppid()
launched_pid = os.environ.get("GIO_LAUNCHED_DESKTOP_FILE_PID")
if launched_pid != str(browser_pid):
logging.debug(
f"Ignoring {desktop_file_name} from GIO_LAUNCHED_DESKTOP_FILE environment,"
f"it comes from process {launched_pid}, not the browser at {browser_pid}."
)
return None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding this correctly, I think this would break if the browser uses a separate process to launch the native messaging binaries than the main process? I think we can probably skip the PID matching check and just read from the desktop file entry.

@michaelbeaumont

Copy link
Copy Markdown
Contributor Author

For my learning purposes, could you submit a log or D-Bus trace (you can use the Bustle app for that) that shows the ID being used on Firefox? It seems curious that the app ID would be different on different distributions since org.mozilla.firefox is perfectly globally unique.

I have to setup credentials portal fork again since i was having issues with it and wireplumber. But there were two issues. The shim was registering itself as org.mozilla.firefox, obviously, since it was hardcoded. But the portal I guess only permits this when it can find a corresponding .desktop file?. So I had to create a org.mozilla.firefox.desktop to get that part to work at all. That's what this PR fixes, it lets firefox get an app id at all.

Then once that's fixed, #233 comes in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants