Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: firefox: places.sqlite in profile getting corrupted #6083

Open
2 tasks done
ryan77627 opened this issue Nov 14, 2024 · 3 comments
Open
2 tasks done

bug: firefox: places.sqlite in profile getting corrupted #6083

ryan77627 opened this issue Nov 14, 2024 · 3 comments
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@ryan77627
Copy link

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

Hi all, experiencing the same issue as described in https://discourse.nixos.org/t/firefox-devtools-broken-with-custom-home-manager-configuration/50539

Making an issue since it is reproducible (sorta) on my end. It's only sort of reproducible on my end since it isn't deterministic when the bug will actually occur. Now that I have a known file I can look at, I will try to figure out what is going on. Anyone more adept at firefox debugging is more than welcome to give me tips on how to go about this. Something of note as well, this does not seem to be triggered by a home-manager switch, it just seems to happen "at some point"

Maintainer CC

@rycee @bricke

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.10.11, Guix System, noversion, nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.16.1`
 - channels(ryan): `"home-manager, nixpkgs-23.11pre491680.31cd1b4afba"`
 - nixpkgs: `/home/ryan/.nix-defexpr/channels/nixpkgs`

(Using flakes so this may be inaccurate in terms of channels and such)


  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/f49e820fbc9450736bb6ba982a2ff0a8d014ad1e";
    home-manager = {
      url = "github:nix-community/home-manager/1d0862ee2d7c6f6cd720d6f32213fa425004be10";
      inputs.nixpkgs.follows = "nixpkgs";
    };

Relevant Firefox configuration

  # Install firefox and add some customizations
  programs.firefox = {
    enable = true;
    policies = {
        EnableTrackingProtection = {
            Value = true;
            Locked = true;
            Cryptomining = true;
            Fingerprinting = true;
            EmailTracking = true;
        };
        UserMessaging = {
            WhatsNew = false;
            ExtensionRecommendations = false;
            FeatureRecommendations = false;
            UrlbarInterventions = false;
            SkipOnboarding = true;
            MoreFromMozilla = false;
            Labs = false;
            Locked = true;
        };
        DisableAppUpdate = true;
        DisableAccounts = true;
        DisableFirefoxAccounts = true;
        DisableFirefoxStudies = true;
        DisablePocket = true;
        DisableTelemetry = true;
        AutofillAddressEnabled = false;
        AutofillCreditCardEnabled = false;
        DisableMasterPasswordCreation = true;
        PasswordManagerEnabled = false;
        PrimaryPassword = false;
        OfferToSaveLogins = false;
        NoDefaultBookmarks = true;
        OverrideFirstRunPage = "";
        OverridePostUpdatePage = "";
        FirefoxHome = {
            Search = true;
            TopSites = true;
            SponsoredTopSites = false;
            Highlights = false;
            Pocket = false;
            SponsoredPocket = false;
            Snippets = false;
            Locked = true;
        };
        SearchSuggestEnabled = true;
        FirefoxSuggest = {
            WebSuggestions = true;
            SponsoredSuggestions = false;
            ImproveSuggest = false;
            Locked = true;
        };
        PictureInPicture = lock-true;
        HardwareAcceleration = true;
        Certificates = {
            ImportEnterpriseRoots = true;
        };
        ExtensionSettings = {
            #"*".installation_mode = "blocked";
            # uBlock Origin
            "uBlock0@raymondhill.net" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
                installation_mode = "force_installed";
            };
            # Bitwarden
            "{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi";
                installation_mode = "force_installed";
            };
            # SponsorBlock
            "sponsorBlocker@ajay.app" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi";
                installation_mode = "force_installed";
            };
            # DeArrow
            "deArrow@ajay.app" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/dearrow/latest.xpi";
                installation_mode = "force_installed";
            };
            # Return Youtube Dislike
            "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/return-youtube-dislikes/latest.xpi";
                installation_mode = "force_installed";
            };
            # Youtube Nonstop
            "{0d7cafdd-501c-49ca-8ebb-e3341caaa55e}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/youtube-nonstop/latest.xpi";
                installation_mode = "force_installed";
            };
            # Sidebery
            "{3c078156-979c-498b-8990-85f7987dd929}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi";
                installation_mode = "normal_installed";
            };
            # TamperMonkey
            "firefox@tampermonkey.net" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/tampermonkey/latest.xpi";
                installation_mode = "force_installed";
            };
            # Floccus
            "floccus@handmadeideas.org" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/floccus/latest.xpi";
                installation_mode = "force_installed";
            };
        };
        Preferences = {
            "browser.startup.homepage" = "https://d.in.rschanz.org";
            "extensions.activeThemeID" = {
                Value = "firefox-compact-dark@mozilla.org";
                Status = "locked";
            };
            "toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
            "xpinstall.whitelist.required" = lock-true;
            "dom.webgpu.enabled" = lock-true;
            "media.eme.enabled" = lock-true;
            "general.autoScroll" = lock-true;
            "general.smoothScroll" = lock-true;
            "browser.crashReports.unsubmittedCheck.autoSubmit2" = lock-false;
            "browser.aboutConfig.showWarning" = lock-false;
        };
    };
    profiles.${config.home.username} = {
        name = "${config.home.username}";
        isDefault = true;
        containersForce = true;
        containers = {
            rit = {
                name = "School";
                color = "orange";
                icon = "dollar";
                id = 1;
            };
            ritwork = {
                name = "Job";
                color = "green";
                icon = "briefcase";
                id = 2;
            };
            other = {
                name = "Other";
                color = "blue";
                icon = "fingerprint";
                id = 3;
            };
        };
        search = {
            force = true;
            default = "DuckDuckGo";
            order = ["DuckDuckGo" "Google"];
            engines = {
                "Nix Packages" = {
                    urls = [
                        {
                            template = "https://search.nixos.org/packages";
                            params = [
                                {
                                    name = "type";
                                    value = "packages";
                                }
                                {
                                    name = "channel";
                                    value = "unstable";
                                }
                                {
                                    name = "query";
                                    value = "{searchTerms}";
                                }
                            ];
                        }
                    ];
                    icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
                    definedAliases = ["@np"];
                };
            };
        };
        userChrome = "
        #main-window #titlebar {
            overflow: hidden;
        transition: height 0.3s 0.3s !important;
        }
        /* Default state: Set initial height to enable animation */
        #main-window #titlebar { height: 3em !important; }
        #main-window[uidensity=\"touch\"] #titlebar { height: 3.35em !important; }
        #main-window[uidensity=\"compact\"] #titlebar { height: 2.7em !important; }
        /* Hidden state: Hide native tabs strip */
        #main-window[titlepreface*=\"\"] #titlebar { height: 0 !important; }
        /* Hidden state: Fix z-index of active pinned tabs */
        #main-window[titlepreface*=\"\"] #tabbrowser-tabs { z-index: 0 !important; }

        /* Sidebery expand on mouse-over and hide otherwise */

        /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0
        See the above repository for updates as well as full license text. */

        /* Show sidebar only when the cursor is over it  */
        /* The border controlling sidebar width will be removed so you'll need to modify these values to change width */

        #sidebar-box{
          --uc-sidebar-width: 60px;
          --uc-sidebar-hover-width: 230px;
          --uc-autohide-sidebar-delay: 200ms; /* Wait 0.2s before hiding sidebar */
          --uc-autohide-transition-duration: 115ms;
          --uc-autohide-transition-type: linear;
          --browser-area-z-index-sidebar: 3;
          position: relative;
          min-width: var(--uc-sidebar-width) !important;
          width: var(--uc-sidebar-width) !important;
          max-width: var(--uc-sidebar-width) !important;
          z-index: var(--browser-area-z-index-sidebar,3);
        }
        #sidebar-box[positionend]{ direction: rtl }
        #sidebar-box[positionend] > *{ direction: ltr }

        #sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr }
        #sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl }

        #main-window[sizemode=\"fullscreen\"] #sidebar-box{ --uc-sidebar-width: 1px; }

        #sidebar-splitter{ display: none }

        #sidebar-header{
          overflow: hidden;
          color: var(--chrome-color, inherit) !important;
          padding-inline: 0 !important;
        }

        #sidebar-header::before,
        #sidebar-header::after{
          content: \"\";
          display: flex;
          padding-left: 8px;
        }

        #sidebar-header,
        #sidebar{
          transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
          min-width: var(--uc-sidebar-width) !important;
          will-change: min-width;
        }
        #sidebar-box:hover > #sidebar-header,
        #sidebar-box:hover > #sidebar{
          min-width: var(--uc-sidebar-hover-width) !important;
          transition-delay: 0ms !important;
        }

        .sidebar-panel{
          background-color: transparent !important;
          color: var(--newtab-text-primary-color) !important;
        }

        .sidebar-panel #search-box{
          -moz-appearance: none !important;
          background-color: rgba(249,249,250,0.1) !important; 
          color: inherit !important;
        }

        /* Add sidebar divider and give it background */

        #sidebar,
        #sidebar-header{
          background-color: inherit !important;
          border-inline: 1px solid rgb(80,80,80);
          border-inline-width: 0px 1px;
        }

        #sidebar-box:not([positionend]) > :-moz-locale-dir(rtl),
        #sidebar-box[positionend] > *{
          border-inline-width: 1px 0px;
        }

        /* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */

        #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel{
          inset-inline: auto 0px !important;
        }
        #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label{
          margin-inline: 0px !important;
          border-left-style: solid !important; 
        }

        /* Remove the tabs label and move the Sidebary icon to the center of the box */
        #sidebar-box:hover [id=\"sidebar-icon\"] {
            transform: translateX(0px) !important;
            transition-delay: 0ms !important;
        }

        #sidebar-box [id=\"sidebar-icon\"] {
            transform: translateX(9px);
            transition: transform var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
        }

        #sidebar-box [id=\"sidebar-title\"] {
            visibility: hidden !important;
            transition: visibility var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
        }

        #sidebar-box:hover [id=\"sidebar-title\"] {
            visibility: visible !important;
            transition-delay: 0ms !important;
        }
        ";
    };
};
@ryan77627 ryan77627 added bug triage Issues or feature request that have not been triaged yet labels Nov 14, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/firefox-devtools-broken-with-custom-home-manager-configuration/50539/10

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/firefox-developer-tools-do-not-work-in-home-manager-installed-firefox/58007/10

@jovandeginste
Copy link

I found that running this query fixes the issue (until it is updated again):

$ sqlite3 places.sqlite
sqlite> update moz_places set frecency = -1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

6 participants