browser_cookie3 icon indicating copy to clipboard operation
browser_cookie3 copied to clipboard

Incorrect detection of Firefox in Linux

Open speckly opened this issue 1 year ago • 3 comments

Was wondering why I could not find the cookie for a specific domain despite it being stored. I found out the issue was that self.cookie_file was the path to my Firefox Developer Edition so I changed the path to the correct Firefox and it worked.

class FirefoxBased:
    """Superclass for Firefox based browsers"""

    def __init__(self, browser_name, cookie_file=None, domain_name="", **kwargs):
        self.browser_name = browser_name
        self.cookie_file = cookie_file or self.__find_cookie_file(**kwargs)
        self.cookie_file = "/home/speckles/.mozilla/firefox/g5cxou3r.default-release-1715532506105/cookies.sqlite" # TODO: Remove this!!!!!!

Perhaps its something to do with __expand_and_check_path in the same class as it returns the first result? edit: yeah it does seem like it imo

image

i use arch btw

speckly avatar Sep 08 '24 04:09 speckly

Experiencing the same on NixOS.

I have a bunch of profiles laying around but they're not the default. browser_cookie3 should use the default profile as selected in Firefox.

Atemu avatar Oct 02 '24 18:10 Atemu

I had to add my desired profile manually at `` line ~913

elif sys.platform.startswith('linux') or 'bsd' in sys.platform.lower():
    user_data_path = self.__expand_and_check_path(linux_data_dirs)
    user_data_path += '/voyqppej.default-release-3'
elif sys.platform == 'win32':

Maybe the containing function should allow optional profile name (much like the domain)

kqvanity avatar Oct 29 '24 09:10 kqvanity

I experienced the same issue, and I was also able to fix it by manually defining self.cookie_file. So I assume there must be a bug in function __expand_and_check_path.

ErikDB87 avatar Apr 17 '25 14:04 ErikDB87