Plasma Browser Integration 1.7.5

I’m pleased to announce the immediate availability of Plasma Browser Integration version 1.7.5 on the Chrome Web Store as well as Firefox Add-Ons page. I hope you’re all safe and well in these odd times. As you can tell from the version number this is a little more than just a maintenance release. It comes with an assortment of important bug fixes, refinements, and translation updates.

Dark blue space background with stars, a cute dragon wearing a red bandana with a "K" on it, sitting ontop of the Earth which has a blue network cable plugged in whose lose end is squiggling around the KDE Plasma logo
Konqi surfing the world wide web

Plasma Browser Integration bridges the gap between your browser and the Plasma desktop. It lets you share links, find browser tabs in KRunner, monitor download progress in the notification center, and control music and video playback anytime from within Plasma, or even from your phone using KDE Connect!

What’s new?

As Chrome Web Store doesn’t appear to offer uploading a changelog, I’ve created a Changelog Page on our Community Wiki instead, which is now also linked on the “About” tab of the extension settings page.

Improved media controls

As usual this release brings various improvements to the media controls feature. The most notable update is for Firefox users since we made some of its aspects work on certain pages with content security policies in place. For example, with this update Spotify Web Player on Firefox can now be controlled again. Special treatment is unfortunately needed as Firefox enforces those policies even for code injected by extensions. While it is good to see such security measures being rolled out across the web, it prevents us from interacting with websites in a way that allows us to provide this functionality. We’re still looking for ways to make it work for all attributes without code duplication but so far this is as good as it gets. Many thanks to Fabian Vogt for helping to investigate this! On top of that, this change unbreaks certain websites that rely on the HTML Audio prototype, most commonly browser games.

Additionally, an issue with audio focus stealing prevention has been corrected. The extension also better handles the case of a media playing browser tab being killed due to low memory or having crashed. However, this can probably only be fully addressed using the processes extension API which is only available in developer builds.

Downloads in recent documents

Task bar with context menu for the Firefox shortcut with a list of recent documents and "New private window" action
Quickly access recently downloaded files without having to launch the browser or search the Downloads folder

For added convenience, Plasma Browser Integration now automatically adds downloaded files to the lists of recent documents available in various parts of the desktop when running Plasma 5.18 LTS or later. Of course this doesn’t apply to files downloaded from incognito tabs, and you can disable this feature in extension settings.

Web Share improvements

Plasma notification from the web browser "Content Shared Successfully: The shared content has been copied to clipboard" with a pointing hand mouse cursor indicating that the notification can be clicked
Clicking a content shared confirmation to open the given link in a new tab

In its previous release Plasma Browser Integration gained support for Web Share API Level 1 through KDE’s Purpose Framework. This lets you share links, images, and other website content to a variety of services, as well as let websites trigger a share prompt by calling navigator.share.

Browser website context men with actions such as back, forward, Save Page As, and the "Plasma Integration" context menu added by this extension with "Share", "Open on My Phone", and "Open on my PC", now with a share, phone, and PC icon, respectively
Multiple share targets with menu icons on Firefox

In this release the “Share…” context menu entry is properly hidden when disabled in settings or while running an older version of Plasma. On Firefox, sharing a link will pass its label to the chosen service as subject/title. Also on Firefox, the context menu now shows a fitting icon when there are multiple reachable devices. Plasma 5.18.5 will also ship a fix so it no longer gets stuck whilst hovering a share target in the menu but then pressing Escape to cancel. Furthermore, after uploading content to a service that returns the shared URL, the confirmation notification can now be clicked to open said content in a new tab.

Better dark mode

Lastly, Firefox was given a light toolbar icon for the browser action when using a dark theme. This is achieved through the theme_icons key which unfortunately isn’t supported by either Chrome or any of the JavaScript extension APIs. I tried manually setting a light icon by querying @media(prefers-color-scheme: dark) but Chrome doesn’t appear to set this automatically on Linux and even if it did, doesn’t necessarily mean the toolbar is dark.

Dark browser toolbar with various light icons, including the Plasma one being hovered by the mouse cursor with a tooltip that reads "Plasma Integration"
Light Plasma toolbar icon in a dark Firefox

Activities coming to Firefox soon?

Plasma browser integration toolbar popup with a list of Activities: "All", "KDE Hacking" (checked), "Movies", "Standard" (bold)
Work in progress and not part of this release: Assigning tabs to different activities

While browsing Firefox documentation the other day I noticed it had the ability to hide tabs from the tab bar. Immediately I realized this would become very handy to add some form of activity-awareness to Firefox. While I can’t control window management, at least I could have tabs inside a window show and hide as you switch activities. With Firefox’ session APIs an activity assignment is even kept when restoring tabs after a reboot. Furthermore, tabs that are hidden can also be muted or unloaded to save resources. This is where I need your input: if you’re a heavy user of Activities, please let me now what you think this feature should behave like and how you would expect to be able to use it.

Opera Store maintainer wanted

Few of you probably knew that the extension actually supported Chromium-based Opera. I always thought you could just install it from the Chrome Web Store, like you can in Vivaldi and other Chromium-based browsers. Recently, I learned that this was not the case – at least not out of the box – so I tried to get it uploaded to the Opera Add-ons page. I had a KDE Community account created and uploaded a package. Unfortunately, despite having been signed with the same key as the Chrome extension, the extension ID turned out different. This meant that existing Plasma releases wouldn’t work with it as we have to specify which extension IDs exactly are allowed to communicate with Plasma.

While this was somewhat inconvenient, the extension then got rejected for retaining the public key in its manifest.json. Admittedly, it is only for development, but this had never been an issue for Chrome or Firefox, and more importantly, it eases development significantly when you can just git clone the repository and run it from there. That being said, if you’re good with build systems and want to maintain our presence on the Opera Add-ons store, please get in touch!

14 thoughts on “Plasma Browser Integration 1.7.5”

  1. About activities. Many years ago exist nepufox projects. I cannot find it recently, but write similar is simple:
    if [ “$1” == “” ]; then
    nazwa=`qdbus-qt5 org.kde.ActivityManager /ActivityManager/Activities CurrentActivity`

    if [ “$nazwa” == “bd87f2d0-2c9d-4206-987f-73951ccc9580” ]; then
    firefox -P Nowy –new-tab “$a” &
    exit 0

    if grep “\[$nazwa\]” $HOME/.mozilla/firefox/profiles.ini; then
    firefox -CreateProfile “$nazwa”
    firefox -p “$nazwa” –new-tab “$a” &

    Nazwa means name. I compare it to bd87f2d0-2c9d-4206-987f-73951ccc9580, because bd87f2d0-2c9d-4206-987f-73951ccc9580 it’s my main activity and I cannot lost settings. Nowy was my default profile. If you want, you could use this script and – of course – remove unnecessary code.

    1. Thanks for your work and this nice post. I’m quite happy about the Firefox plasma integration.
      But I would prefer the solution for activities in the previous comment. It is quite close to what I already use to integrate Firefox and activities. But more important I think using Firefox in different activities is more than just the set of opened tabs. For example I have different add-ons for different activities. For my working activities I block many websites. For development activities with more apps for web development.

        1. Came here to suggest this. Since Firefox provided Containers, I always wanted to link them to Activities (I believe Ivan Čukić built something basically usable at some point), but never really found a way to make it work for me.

          1. I never had the Containers integration, though always wanted it since Firefox introduced Containers.

            I had (still use) a script inspired by a KDE user I forgot the name of that opens an activity-specific Firefox profile.

            Now, as an insane person, I also have containers inside those profiles, so I’m unsure how a 1-1 mapping between containers and activities would suit me these days.

        2. Just commenting to agree with the previous two posters, I feel that KDE Activities map more closely to Firefox profiles than containers.

          My hacky semi-manual way of mapping profiles to activities is similar to Sław’s but instead of a script I just have a custom firefox.desktop in my ~./.local/share/applications directory which overrides the distro-installed one. When I create a new activity I just manually create a Firefox profile with the same name. Then modifying the Exec line in the .desktop file to:

          Exec=/usr/lib/firefox/firefox -P “`qdbus org.kde.ActivityManager /ActivityManager/Activities ActivityName $(qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity)`” %u

          launches the correct profile.

          Unfortunately this doesn’t work so great when you have Plasma set to re-open the running applications when you log out and back in. If multiple profiles were open in their respective activities when logging out, the profiles don’t re-open in the correct activities when logging back in (so I’ve gotten used to closing Firefox before I log out or shut down). I’m not sure whether plasma-browser-integration is the right place for this to be worked out (or some other part of KDE/Plasma).

          Ideally if a more integrated solution was made it would automatically create and link a new profile to a new activity (using UIDs rather than names, so renaming either the activity or profile would work). But again, this seems like it might be something that belongs more in the Activities part of KDE code than in browser integration.

          But even without support for activities, plasma-browser-integration makes my whole Plasma experience much better, thanks so much for all the work you’ve put into it already!

          1. Nice workaround, I use something similar but in a shell script.

            Do your solution solve the problem of open a link from an application in the currently Firefox profile in use? Or is it always open in the default Firefox profile?


  2. Hello, thanks for the nice post, it’s really good to know progress and plans on plasma browser integration.

    More integration with activities would indeed be great:

    – Feedback on hiding tabs depending on activities: I’m sure would be useful for some set-up (for those wanting to have one main window open across their activities) and could potentially solve any other use cases. It would be nice to right click on a tab and select and activity, or create activity groups (potentially requiring the group tab add-on for this to work).

    – Activity specific user profile would be great too for other use cases.

    – Enable plasma to better remember which Firefox window belong to which activity after reboot would be REALLY useful (capital letters as of course I mean…useful to me ;) ). This “kinda works” in a simple set-up but with 2-3 Firefox windows in each of my 5 activities, it’s a real mess each time I reboot (the main reason why I dread anytime I need to reboot to be honest). I use only one profile. There are a few bug reports open on this but it seems devs got stuck making attempts to get it work properly.
    I suppose this would be partially solved by the hiding / showing tab feature, especially if this is well remembered on reboot…so here is a potentially way forward and a good use case of the feature :)

    Thank you for all the great work!

  3. Perhaps late to the game, but better late then never …

    I use activities heavily and Firefox is one of the few more bothersome applications.

    The way I currently combine them is that for each Activity I use a browser in, I open a new Firefox window and send it to that Activity, and then suspend/stop the Activities (incl. the browser windows) that I currently don’t use. It’s far from perfect, and I’m looking forward to a better solution from the KDE community :)

    What I hope to achieve with Activity-awareness of the browser is:
    • to keep Activity-related tabs only in those Activities – for my use case, any tabs that should be in more than one Activity, can safely be just pinned (others might have a different opinion though)
    • when don’t use an Activity, I reclaim the resources by stopping it – this should also happen for the browser windows/tabs
    • when I start again an Activity, (only!) the relevant windows/tabs should start again

    For my use case, I don’t need to have per-Activity bookmarks, profiles, containers etc., but I can see how some might.

    I also use the Memex app for managing/indexing/annotating the pages I’ve seen and Tree-style Tabs for managing tabs, which might be relevant.

  4. Yes! I would very much appreciate activity-aware browser tabs! This is a sorely needed feature. It sounds lighter weight than a separate activity-aware profile, which I would prefer.

    I currently have 5 activities: General, Code, Work, Study, Play, and Present. I frequently send browser windows between the activities (mostly during after a reboot or re-login) and also have them show on multiple activities. Each window will have dozens of tabs open, and I frequently run out of my 16 GB of memory (due to poor javascript code from web sites), so the ability to unload the tabs when inactive is a boon!

  5. Hello Kai,

    I use activities mainly for sub session management – every project I work on has its own activity so I can open and suspend all windows connected to each project (editors, browser windows, okular, gwenview, …) independently from each other – in any constellation (one day project 2, 3 and 6; next day 3, 6 and 8; weekend: 1 and 3; …) that suits my needs.

    My preference for Firefox to cooperate with activities was to behave like Konqueror did up to version 17.04. Closing an activity closes the corresponding windows and frees their resources. Starting the activity again restores all windows in their previous state (associated workspace, data shown, geometry).
    Additionally I’d like to show the taskbar the favicon of the currently active tab of each Firefox window (like Konqueror was able to do).

Leave a Reply

Your email address will not be published. Required fields are marked *