Announcement

Collapse
No announcement yet.

firefox snap ignoring browser.cache.disk.parent_directory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Post-Install] firefox snap ignoring browser.cache.disk.parent_directory

    I like to keep browser cache data out of my home directory subvolumes, to avoid my backups handling cache data. On my desktop I have set (in about:config) browser.cache.disk.parent_directory​ to direct firefox's cache elsewhere, and this works. But on my tiny PC, which presently is used only for firefox, this setting is ignored.

    On the tiny PC, firefox is a snap, and the cache data are in ~/snap/firefox/common/.cache. Is there some snap limitation on file access makes it ignore the setting?



    Regards, John Little

    #2
    There are probably a few ways to give FF access to locations outside of $HOME.

    One is to remove the snap, and install it using the --classic switch.

    Another is to add the :all connection: snap connect firefox:all, which does allow access to all outside directory locations, and iirc is a bit similar to using --classic, which is analogous to being like a deb install.

    Or connecting it to :removeable-media for access to /media and maybe /mnt, instead of the whole.


    https://snapcraft.io/docs/interfaces
    https://snapcraft.io/docs/supported-interfaces


    A third might be to use a bind mount for the location you want to store the profile.
    So something like:
    Code:
    /home/username/snap/firefox/common/.cache    /mnt/ff_cache     none         defaults,bind         0 0


    Connecting the snap to :all is the quickest, and probably just fine for the purpose.

    I am playing with the Jellyfin snap on my PC as a very easy way to test the media server (instead of mucking with Docker installation) while I wait for my NAS to get shipped down here, finally.

    This snap by its nature doesn't have access to my user directories, as it is using jellyfin as its user account. But my tunes are in my $HOME. So I set up a bind mount from ~/Music to /media/Music and Jellyfin was able to see the files. The snap has access to /media and /mnt.

    Binds are a new thing to me, I just learned about using them recently.

    Comment


      #3
      Thank you; your reply is what I hoped for. I'll be checking out the snapcraft docs.

      I've used bind mounts to solve problems like this before.
      Regards, John Little

      Comment


        #4
        Originally posted by claydoh View Post
        Another is to add the :all connection: snap connect firefox:all, which does allow access to all outside directory locations
        Code:
        $ sudo snap connect firefox:all
        error: snap "firefox" has no plug named "all"
        Or connecting it to :removeable-media for access to /media and maybe /mnt, instead of the whole.
        Code:
        $ sudo snap connect firefox:removeable-media
        error: snap "firefox" has no plug named "removeable-media"
        I looked at the documentation you kindly linked, and adding a plug or interface to existing snap. There's a huge containment subsystem for snaps that I had no idea about. There doesn't seem to be

        A third might be to use a bind mount for the location you want to store the profile.
        I'd like the profile to remain in the @home subvolume; the firefox profile is, on this box, the most important data. But I'll experiment with a bind mount just for the cache data.

        I've achieved the result I wanted by simply making one of the directories on the path to the cache its own nested subvolume. But that approach causes a problem if I came to a restore from backup; I'd have to remember to recreate the subvolume. With a bind mount (with the right options) the story is documented in /etc/fstab.

        So I'll check out using a bind mount. I won't be surprised if it runs afoul of the snap containment mechanisms; though a nested btrfs subvolume is just like a bind mount.
        Regards, John Little

        Comment


          #5
          Um, a typo my spellcheck missed:

          Originally posted by claydoh View Post
          :removeable-media
          Should be:removable-media​

          Comment

          Users Viewing This Topic

          Collapse

          There are 0 users viewing this topic.

          Working...
          X