// Required startup
pref("toolkit.defaultChromeURI", "chrome://epoch/content/browser.xul");
pref("toolkit.defaultChromeFeatures", "chrome,resizable,centerscreen,dialog=no");

// Startup page
pref("browser.startup.homepage", "https://www.google.com/");
pref("browser.startup.page", 1);

// === Performance tuning for old PCs ===
// JS heap cap (MB × 1024)
pref("javascript.options.mem.max", 131072);       // 128 MB JS heap ceiling
pref("javascript.options.mem.gc_incremental", true);
pref("javascript.options.mem.gc_compacting", false); // compacting GC is slow

// Network cache (KB)
pref("browser.cache.memory.enable", true);
pref("browser.cache.memory.capacity", 16384);     // 16 MB memory cache
pref("browser.cache.disk.enable", true);
pref("browser.cache.disk.capacity", 51200);       // 50 MB disk cache
pref("browser.cache.disk.max_entry_size", 5120);  // 5 MB max single entry

// Session / tab history limits
pref("browser.sessionhistory.max_entries", 10);
pref("browser.tabs.max_tabs_undo", 3);

// Network connections
pref("network.http.max-connections", 20);
pref("network.http.max-connections-per-server", 4);
pref("network.http.max-persistent-connections-per-server", 2);
pref("network.http.pipelining", true);
pref("network.http.proxy.pipelining", true);

// Layout / paint throttling (ms)
pref("nglayout.initialpaint.delay", 250);
pref("content.notify.interval", 120000);
pref("content.notify.backoffcount", 5);

// TLS (XP caps at TLS 1.2)
pref("security.tls.version.min", 1);
pref("security.tls.version.max", 3);

// Security / UX
pref("dom.disable_open_during_load", true);
pref("javascript.enabled", true);
pref("browser.tabs.autoHide", false);
pref("app.update.enabled", false);
pref("app.update.auto", false);
pref("browser.download.useDownloadDir", true);
pref("browser.download.folderList", 1);  // 1 = Desktop
pref("network.proxy.type", 0);

// UA string: spoof Chrome 131 so modern sites (YouTube, etc.) don't redirect.
// lockPref overrides any saved profile value.
lockPref("general.useragent.override",
     "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36");
