Bug 495982

Summary: Snap-based firefox can fail to pop up the permissions box -- suggested documentation fix
Product: [Plasma] plasma-browser-integration Reporter: Henry Wertz <hwertz10>
Component: FirefoxAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED DOWNSTREAM    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Henry Wertz 2024-11-08 18:40:16 UTC
SUMMARY
On some Ubuntu installs, Firefox (or snap, whichever should be responsible) never gives a notice about allowing browser extension integration (with native host), and just denies it.  plasma-browser-integration is basically entirely a bridge between firefox and "native host" KDE, so it renders the extension non-functional.  There's a workaround, which I suggest putting into the documentation.

STEPS TO REPRODUCE
1. Choose the notice on the KDE notification area to install KDE plasma integration
2. Install the extension
3. Notification bar still has notice to install the plasma integration, and it's controls in Firefox indicate "failure to connect to the native host".

OBSERVED RESULT
See STEPS TO REPRODUCE

EXPECTED RESULT
It should ask for permission then be all nicely integrated.

SOFTWARE/OS VERSIONS

(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Ubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel 6.8.0-45-generic (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
My Ubuntu 22.04 install has been multiply upgraded -- I assume something "broke" during one of the upgrades that it never asks for permission for native host integration for extensions... when I first had this happen (with Video DownloadHelper) I assumed it was some one-off problem I had, but it's happened to enough people that there's bugs filed, and VDH's help page has documentation on how to fix the issue.

I suggest a documentation update -- the "failure to connect to native host" links to  this page https://community.kde.org/Plasma/Browser_Integration .  I suggest adding info like they have here (Video Downloadhelper has the same issue, and they have a working fix)  https://github.com/aclap-dev/video-downloadhelper/wiki/CoApp-not-recognized

In short, you run 
sudo apt-get install -y flatpak
flatpak permission-set webextensions org.kde.plasma.browser_integration snap.firefox yes

(Why snap has this problem... why the snap developers, or the developers of the snap firefox package, haven't figured out the root cause to make it ask for permission like it's supposed to in these cases where it doesn't... and why snap doesn't have a tool to manage these permissions, but flatpak not only does have a tool but has one that also works with snap permissions?  I don't know, just imagine I have a giant rant about Snap here.)  

Of course this apt-get command is not distro-neutral, but as far as I know only Ubuntu (and some Ubuntu-derived distros that also use apt-get) have a snap-based version of Firefox anyway.

Thanks!
--Henry
Comment 1 Kai Uwe Broulik 2024-11-09 11:56:43 UTC
This is a downstream issue if Snap sabotages the browser, that’s on them. Feel free to edit the Wiki page to include a workaround.