brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.88k stars 2.34k forks source link

Chromium-based extensions can't communicate with desktop programs (KDE Neon, KDE Plasma) #17537

Open amenaijp opened 3 years ago

amenaijp commented 3 years ago

Description

Extensions that need to communicate with a desktop application to do their job (currently I have two extensions that do this, Plasma integration and uget integration) can't communicate with their desktop applications. This bug appears to be brave specific as Plasma integration's firefox version works fine. (KDE Neon is essentially Ubuntu with Plasma preinstalled and a bunch of other changes, shouldn't make too much of a difference but it has before)

Steps to Reproduce

  1. Get any extension that needs to talk with a desktop application to work properly
  2. Get the extension's web application

Actual result:

Extensions don't seem to be able to talk with the applications, screenshots if helpful image image

Expected result:

Extensions working normally, and doing what they're meant to

Reproduces how often:

Always does this

Brave version (brave://version info)

1.28.105 Chromium: 92.0.4515.131 (Official Build) (64-bit) 6b8d6c56ce21e38a72f7c4becb5abc1fa5134f29-refs/branch-heads/4515@{#1933} Linux

Version/Channel Information:

Other Additional Information:

Miscellaneous Information:

In brave://flags, #brave-extension-network-blocking is set to "default" installed from snap

rebron commented 3 years ago

cc: @fmarier

fmarier commented 3 years ago

I've never tried this on KDE, but I have successfully used the GNOME equivalent and it requires the chrome-gnome-shell package to be installed.

Do you have the plasma-browser-integration package installed?

I see that you are using the snap package. Are you able to test using the packages in our official PPA? I'm wondering whether this problem is only in the snap version of Brave, which is subject to extra restrictions.

amenaijp commented 3 years ago

Yea the integration package is installed, the extension worked fine in the official PPA version so the snap one's broken.

fmarier commented 3 years ago

Thanks @AmethystEdits .

@wknapik That might be another snap permission we need to request from Canonical.

wknapik commented 3 years ago

Plugs automounted by Chromium, but not Brave:

% diff -u <(snap connections chromium|awk '{print $3}'|sed 's/chromium//g'|grep -v '^-$'|sort) <(snap connections brave|awk '{print $3}'|sed 's/brave//g'|grep -v '^-$'|sort)|grep '^-[^-]'
-:audio-record
-:bluez
-:joystick
-:network-bind
-:personal-files
-:system-files
-:system-packages-doc
-gnome-3-28-1804:gnome-3-28-1804
%

Plugs automounted by Firefox, but not Brave:

% diff -u <(snap connections firefox|awk '{print $3}'|sed 's/firefox//g'|grep -v '^-$'|sort) <(snap connections brave|awk '{print $3}'|sed 's/brave//g'|grep -v '^-$'|sort)|grep '^-[^-]'
-:avahi-observe
-:dbus-daemon
-:hardware-observe
-:system-files
-:system-packages-doc
-gnome-3-38-2004:gnome-3-38-2004
%

Do these extensions work with the Chromium snap? To test: sudo snap install chromium && snap run chromium.

@fmarier do I understand correctly that the gnome extension works for you in the Brave snap?

Some instructions for testing this would be helpful. I don't quite get what these extensions are supposed to do.

fmarier commented 3 years ago

do I understand correctly that the gnome extension works for you in the Brave snap?

Not in the snap. I've only tested this in the normal package.

Some instructions for testing this would be helpful. I don't quite get what these extensions are supposed to do.

Here's what I did:

  1. Install the brave-browser package from our repo (I only tested the release channel).
  2. Install the chrome-gnome-shell package from Ubuntu repo.
  3. Start Brave and install https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep
  4. Open https://extensions.gnome.org/extension/6/applications-menu/ and click the toggle button: gnome-extension-toggle
  5. Check that the GNOME extension has loaded and the Applications menu is present in the top-left corner: applications-menu
wknapik commented 3 years ago

Seems this doesn't work in other browser snaps (including Chromium and Firefox) and we can't fix it ourselves.

There's a bunch of bug reports and discussion threads out there, these seem especially relevant:

I think for now all we can do is wait.

Those who care about this integration should probably switch to the regular non-snap package (see: https://brave.com/linux).

PS. Once things are unblocked on the snapcraft side, we will have to add extensions: [gnome-3-28] (or extensions: [gnome-3-34], newer only if we upgrade core) under apps.brave. More tweaks may be needed.

soumyaDghosh commented 2 years ago

This thing is already solved in the firefox snap, so I guess other browsers can also improve from it. New updates have also improved the startup speed in the firefox snap. I think a small team can work on that.

soumyaDghosh commented 1 year ago

I think, at this moment brave should enable native messaging also, just like in firefox. You guys should use something like this. https://github.com/canonical/firefox-snap/blob/stable/patches/native-messaging-portal.patch

bsclifton commented 1 year ago

@soumyaDghosh do you know if this is working now? It should have been addressed with https://github.com/brave/brave-browser-snap/pull/25

soumyaDghosh commented 1 year ago

Installed brave from latest/edge and it's still the same. It can't be fixed by just some changes in the snap manifest. It needs changes in the source.

mihaiplesa commented 2 days ago

@soumyaDghosh is this still an issue?

soumyaDghosh commented 2 days ago

@soumyaDghosh is this still an issue?

Yes, this is still an issue, and as explained before, this needs fixes in the source code of brave itself. I have never heard any chromium based browsers to make this work from within sandbox, be it snap or flatpak.