feat: 增加 FireFox 站点隔离机制开关

This commit is contained in:
foxhui
2026-01-11 22:17:19 +08:00
Unverified
parent 9ef7604135
commit 1594aa17f5
19 changed files with 51 additions and 15 deletions
+3 -1
View File
@@ -306,7 +306,9 @@ export async function initBrowserBase(config, options = {}) {
// 禁用背景模糊滤镜 (高 CPU 消耗)
'layout.css.backdrop-filter.enabled': false,
// 告诉网页用户倾向于减少动画 (触发网页自身的优化)
'ui.prefersReducedMotion': 1
'ui.prefersReducedMotion': 1,
// 站点隔离
...(browserConfig.fission === false ? { 'fission.autostart': false } : {})
}
};
+2
View File
@@ -81,6 +81,7 @@ export function getBrowserConfig() {
return {
path: browser.path || '',
headless: browser.headless || false,
fission: browser.fission !== false, // 默认 true
proxy: {
enable: proxy.enable || false,
type: proxy.type || 'http',
@@ -104,6 +105,7 @@ export function saveBrowserConfig(data) {
if (data.path !== undefined) config.browser.path = data.path;
if (data.headless !== undefined) config.browser.headless = data.headless;
if (data.fission !== undefined) config.browser.fission = data.fission;
if (data.proxy) {
if (!config.browser.proxy) config.browser.proxy = {};
+5
View File
@@ -77,6 +77,11 @@ export function validateBrowserConfig(data) {
errors.push('headless 必须是布尔值');
}
// Fission 校验
if (data.fission !== undefined && typeof data.fission !== 'boolean') {
errors.push('fission 必须是布尔值');
}
// Proxy 校验
if (data.proxy) {
if (data.proxy.enable !== undefined && typeof data.proxy.enable !== 'boolean') {