feat(firefox): generalize youtube profile into modular web-app profile
- Renamed profiles/youtube.nix to profiles/web-app.nix. - Refactored to accept id, name, and url as arguments. - Added settings to force homepage on startup and new tabs. - Disabled session restore and undo-close-tab for web-app profiles.
This commit is contained in:
@@ -49,7 +49,12 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
profiles = {
|
profiles = {
|
||||||
youtube = import ./profiles/youtube.nix {inherit pkgs myConfig;};
|
youtube = import ./profiles/web-app.nix {
|
||||||
|
inherit pkgs myConfig;
|
||||||
|
id = 1;
|
||||||
|
name = "YouTube";
|
||||||
|
url = "https://youtube.com";
|
||||||
|
};
|
||||||
hakase = {
|
hakase = {
|
||||||
search.force = true;
|
search.force = true;
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
|
|||||||
@@ -0,0 +1,129 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
myConfig,
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
url,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
inherit id name;
|
||||||
|
search.force = true;
|
||||||
|
search.default = "ddg";
|
||||||
|
extensions.force = true;
|
||||||
|
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
|
ublock-origin
|
||||||
|
bitwarden
|
||||||
|
tridactyl
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
# --- Privacy & Hardening ---
|
||||||
|
"browser.contentblocking.category" = "strict";
|
||||||
|
"privacy.trackingprotection.enabled" = true;
|
||||||
|
"privacy.resistFingerprinting" = true; # Note: Spoofs timezone and caps FPS to 60
|
||||||
|
"geo.enabled" = false;
|
||||||
|
"media.peerconnection.enabled" = false; # Prevents WebRTC IP leaks
|
||||||
|
"network.dns.disablePrefetch" = true;
|
||||||
|
"network.prefetch-next" = false;
|
||||||
|
|
||||||
|
# --- NixOS / Hyprland Integration ---
|
||||||
|
"widget.use-xdg-desktop-portal.file-picker" = 1; # Use native file picker
|
||||||
|
|
||||||
|
# --- UI & Behavior ---
|
||||||
|
"browser.compactmode.show" = true;
|
||||||
|
"browser.tabs.closeWindowWithLastTab" = false;
|
||||||
|
"extensions.pocket.enabled" = false;
|
||||||
|
"extensions.screenshots.disabled" = true;
|
||||||
|
"browser.topsites.contile.enabled" = false;
|
||||||
|
"browser.formfill.enable" = false;
|
||||||
|
"browser.search.suggest.enabled" = false;
|
||||||
|
"browser.search.suggest.enabled.private" = false;
|
||||||
|
"browser.urlbar.suggest.searches" = false;
|
||||||
|
"browser.urlbar.showSearchSuggestionsFirst" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.snippets" = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsored" = false;
|
||||||
|
"browser.newtabpage.activity-stream.system.showSponsored" = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||||
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||||
|
"extensions.autoDisableScopes" = 0; # Enable extensions by default
|
||||||
|
|
||||||
|
# --- Homepage & Navigation ---
|
||||||
|
"browser.startup.page" = 1; # Always open the homepage
|
||||||
|
"browser.startup.homepage" = url;
|
||||||
|
"browser.newtab.url" = url; # Try to set newtab to homepage
|
||||||
|
"browser.sessionstore.resume_from_crash" = false; # Always start fresh
|
||||||
|
"browser.sessionstore.max_tabs_undo" = 0; # Disable undo close tab
|
||||||
|
|
||||||
|
# --- Tridactyl (attempt to override) ---
|
||||||
|
# We can't easily set per-profile tridactylrc, but we can try to minimize its newtab impact
|
||||||
|
};
|
||||||
|
|
||||||
|
userChrome = ''
|
||||||
|
"network.trr.mode" = 2; # Use DoH with system fallback
|
||||||
|
"network.trr.uri" = "https://dns.quad9.net/dns-query";
|
||||||
|
};
|
||||||
|
|
||||||
|
userChrome = ''
|
||||||
|
/* --- Floating Autohide Toolbox (Tabs Only) --- */
|
||||||
|
|
||||||
|
/* Take toolbox out of the document flow so web content is 100% height */
|
||||||
|
#navigator-toolbox {
|
||||||
|
position: fixed !important;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9999 !important;
|
||||||
|
background-color: var(--toolbar-bgcolor, #1c1b22) !important;
|
||||||
|
|
||||||
|
/* Start hidden */
|
||||||
|
transform: translateY(-100%) !important;
|
||||||
|
opacity: 0 !important;
|
||||||
|
transition: transform 0.2s ease, opacity 0.2s ease !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Trigger zone */
|
||||||
|
#navigator-toolbox::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 10px;
|
||||||
|
z-index: 10000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reveal when hovering */
|
||||||
|
#navigator-toolbox:hover {
|
||||||
|
transform: translateY(0) !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Hide specific bars --- */
|
||||||
|
|
||||||
|
/* Hide Navigation Bar (Address Bar) COMPLETELY */
|
||||||
|
#nav-bar {
|
||||||
|
visibility: collapse !important;
|
||||||
|
height: 0px !important;
|
||||||
|
min-height: 0px !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide Bookmarks Toolbar */
|
||||||
|
#PersonalToolbar { visibility: collapse !important; }
|
||||||
|
|
||||||
|
/* Hide Titlebar */
|
||||||
|
#titlebar { appearance: none !important; }
|
||||||
|
|
||||||
|
/* Ensure TabsToolbar looks okay on its own */
|
||||||
|
#TabsToolbar {
|
||||||
|
border: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -60,61 +60,44 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
userChrome = ''
|
userChrome = ''
|
||||||
/* --- Floating Autohide Toolbox (Tabs Only) --- */
|
/* Hide the Navigation Bar by default */
|
||||||
|
#nav-bar {
|
||||||
/* Take toolbox out of the document flow so web content is 100% height */
|
height: 0px !important;
|
||||||
#navigator-toolbox {
|
min-height: 0px !important;
|
||||||
position: fixed !important;
|
overflow: hidden !important;
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 9999 !important;
|
|
||||||
background-color: var(--toolbar-bgcolor, #1c1b22) !important;
|
|
||||||
|
|
||||||
/* Start hidden */
|
|
||||||
transform: translateY(-100%) !important;
|
|
||||||
opacity: 0 !important;
|
opacity: 0 !important;
|
||||||
transition: transform 0.2s ease, opacity 0.2s ease !important;
|
transition: height 0.3s ease, opacity 0.3s ease !important;
|
||||||
|
z-index: 100 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Trigger zone */
|
/* Show the Navigation Bar on hover over the navigator toolbox */
|
||||||
#navigator-toolbox::after {
|
#navigator-toolbox:hover #nav-bar,
|
||||||
content: "";
|
#nav-bar:focus-within {
|
||||||
position: absolute;
|
height: 40px !important; /* Adjust based on your density settings */
|
||||||
top: 100%;
|
min-height: 40px !important;
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 10px;
|
|
||||||
z-index: 10000 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reveal when hovering */
|
|
||||||
#navigator-toolbox:hover {
|
|
||||||
transform: translateY(0) !important;
|
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Hide specific bars --- */
|
/* Auto-hide Tabs Toolbar */
|
||||||
|
#TabsToolbar {
|
||||||
/* Hide Navigation Bar (Address Bar) COMPLETELY */
|
|
||||||
#nav-bar {
|
|
||||||
visibility: collapse !important;
|
|
||||||
height: 0px !important;
|
height: 0px !important;
|
||||||
min-height: 0px !important;
|
min-height: 0px !important;
|
||||||
padding: 0 !important;
|
overflow: hidden !important;
|
||||||
margin: 0 !important;
|
opacity: 0 !important;
|
||||||
|
transition: height 0.3s ease, opacity 0.3s ease !important;
|
||||||
|
z-index: 100 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show Tabs Toolbar on hover over the navigator toolbox */
|
||||||
|
#navigator-toolbox:hover #TabsToolbar {
|
||||||
|
height: 30px !important; /* Adjust based on your tab height preference */
|
||||||
|
min-height: 30px !important;
|
||||||
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide Bookmarks Toolbar */
|
/* Hide Bookmarks Toolbar */
|
||||||
#PersonalToolbar { visibility: collapse !important; }
|
#PersonalToolbar {
|
||||||
|
visibility: collapse !important;
|
||||||
/* Hide Titlebar */
|
|
||||||
#titlebar { appearance: none !important; }
|
|
||||||
|
|
||||||
/* Ensure TabsToolbar looks okay on its own */
|
|
||||||
#TabsToolbar {
|
|
||||||
border: none !important;
|
|
||||||
background: transparent !important;
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user