Firefox85,计划于下个月,2021年1月发布,将附带名为网络分区的功能,作为新形式的反跟踪保护。
该功能基于“客户端存储分区”,这是一个由World Wide Web Consortium的Privacy Community Group。
“网络分区技术性很强,但为了简化它;您的浏览器有许多方法可以从网站保存数据,而不仅仅是通过Cookie,研究员Zach Edwards在本周的一次采访中告诉ZDNet。
“这些其他存储机制包括HTTP缓存、图像缓存、favicon缓存、字体缓存、CORS飞行前缓存以及其他多种存储机制缓存和存储机制可用于跨网站跟踪人员。“
爱德华兹说,所有这些数据存储系统都是在网站之间共享的。
不同之处在于,网络分区将允许Firefox在每个网站的基础上,而不是一起,节省诸如缓存、favicon、CSS文件、图像等资源同一个池。
这使得网站和第三方(如广告和网络分析公司)更难跟踪用户,因为他们无法探测此共享池中是否存在其他网站的数据。
根据Mozilla的说法,以下网络资源将从Firefox85开始分区:
- HTTP缓存
- 映像缓存
- Favicon缓存
- 连接池
- 样式表缓存
- DNS
- HTTP验证
- Alt-Svc
- 推测性连接
- Font缓存
- HSTS
- OCSP
- 中间CA缓存
- TLS客户端证书
- TLS会话标识符
- 预取
- 预连接
- CORS飞行前缓存
,但Mozilla将部署迄今为止最广泛的用户数据“分区系统”,Firefox的第一个创造者不是爱德华兹https://bugs.webkit.org/show\u bug.cgi?id=110269“target=”unu blank“rel=”noopener noreferrer nofollow“data component=”externalLink“>在2013年开始对HTTP缓存进行分区,然后在数年后对更多的用户数据存储系统进行分区,作为其跟踪预防功能https://www.zdnet.com/article/chrome-changes-how-its-cache-system-works-to-improve-privacy/“target=”\u blank“>谷歌还对HTTP进行了分区上个月,随着chrome86的发布,缓存的效果马上就显现出来了,作为Google Fonts失去了一些性能指标,因为它无法再在共享的HTTP缓存中存储字体。
Mozilla团队预计Firefox中加载的站点也会出现类似的性能问题,但它愿意承担这一打击,仅仅是为了提高用户的隐私。
“大多数决策者和数字战略家都关注第三方cookie的消亡,但还有许多其他指纹识别技术和用户跟踪策略需要被浏览器打破,”Edwards还ZDNet,称赞Mozilla的举动。
PS:Mozilla还说部署网络分区的副作用是Firefox85最终能够阻止“超级计算机”更好,一种浏览器cookie文件,它滥用各种共享存储介质来保存浏览器,并允许广告商跟踪用户在web上的移动。
Apple、Google、Microsoft和Mozilla禁止哈萨克斯坦的MitM HTTPS证书,“pageType”:“article”}>FBI&Interpol disrupt Joker's Stash,互联网最大的梳理市场
a, .nav-item > a, .dropdown-menu a');
allLinks.forEach(link => {
let href = link.getAttribute('href');
if (!href || href === '#' || href === 'javascript:;') return;
// 4. 提取菜单中的核心路径
// 例如 /articles.html -> articles
let cleanHref = href.replace(/^\/|\/$/g, '').replace(/\.(html|php)$/, '').toLowerCase();
let isMatch = false;
// 5. 精确匹配逻辑
if (cleanHref === 'index') {
// 只有当前是首页时,才高亮首页
if (cleanPath === 'index') isMatch = true;
} else {
// 如果当前路径完全等于菜单路径 (如 /articles 匹配 /articles)
// 或者当前路径以 "菜单路径/" 开头 (如 /articles/154 匹配 /articles)
// 或者当前路径包含 "菜单路径." (防某些带点号的特殊情况)
if (cleanPath === cleanHref || cleanPath.startsWith(cleanHref + '/')) {
isMatch = true;
}
}
// 6. 如果匹配成功,加上高亮
if (isMatch) {
link.classList.add('active');
// 如果匹配的是下拉菜单里的子项,顺便把它的父级分类也高亮
const parentNavItem = link.closest('.nav-item');
if (parentNavItem && !parentNavItem.classList.contains('active')) {
const parentLink = parentNavItem.querySelector('a');
if (parentLink) parentLink.classList.add('active');
}
}
});
})();
// ================= 移动端菜单逻辑 =================
const toggle = document.getElementById("menuToggle");
const nav = document.getElementById("navLinks");
// 1. 汉堡按钮:切换主菜单显示/隐藏
if (toggle && nav) {
toggle.addEventListener("click", function (e) {
e.stopPropagation();
const expanded = this.getAttribute("aria-expanded") === "true";
this.setAttribute("aria-expanded", String(!expanded));
nav.classList.toggle("active");
});
}
// 2. 处理下拉子菜单的展开/折叠
if (window.innerWidth <= 768) {
const navItems = document.querySelectorAll(".nav-item");
navItems.forEach((item) => {
const titleLink = item.querySelector("a");
const dropdownMenu = item.querySelector(".dropdown-menu");
const arrowIcon = item.querySelector(".arrow-icon");
if (titleLink && dropdownMenu) {
titleLink.addEventListener("click", function (e) {
e.preventDefault(); // 阻止链接跳转
e.stopPropagation();
// 手风琴效果:收起其他已展开的菜单
navItems.forEach((otherItem) => {
if (otherItem !== item) {
const otherMenu = otherItem.querySelector(".dropdown-menu");
const otherArrow = otherItem.querySelector(".arrow-icon");
if (otherMenu) otherMenu.classList.remove("active");
if (otherArrow) otherArrow.style.transform = "rotate(0)";
}
});
// 切换当前菜单
dropdownMenu.classList.toggle("active");
if (arrowIcon) {
arrowIcon.style.transform = dropdownMenu.classList.contains(
"active",
)
? "rotate(180deg)"
: "rotate(0)";
}
});
}
});
}
// 3. 点击普通菜单项后,自动关闭整个主菜单
if (nav) {
nav.querySelectorAll("a").forEach(function (link) {
if (!link.querySelector(".arrow-icon")) {
link.addEventListener("click", function () {
nav.classList.remove("active");
if (toggle) toggle.setAttribute("aria-expanded", "false");
});
}
});
}
// ================= 返回顶部逻辑 =================
(function () {
const backToTop = document.getElementById("backToTop");
window.addEventListener("scroll", function () {
if (window.scrollY > 300) {
backToTop.classList.add("show");
} else {
backToTop.classList.remove("show");
}
});
backToTop.addEventListener("click", function () {
window.scrollTo({ top: 0, behavior: "smooth" });
});
})();
// 多语言
document.addEventListener("DOMContentLoaded", function() {
let path = window.location.pathname;
let isEn = path.startsWith('/en/');
if (isEn) {
document.cookie = "my_lang=en; path=/; max-age=" + (30 * 24 * 3600);
} else {
document.cookie = "my_lang=zh; path=/; max-age=" + (30 * 24 * 3600);
}
// 【2. 首页记忆】如果访问的是首页(没带 en),但记忆是英文,前端自动跳去英文首页
if (!isEn && (path === '/' || path === '/index.html')) {
if (document.cookie.includes('my_lang=en')) {
window.location.replace('/en' + path);
return;
}
}
// 【3. 菜单不掉线】如果是英文页面,自动给菜单链接加上 /en/
if (isEn) {
document.querySelectorAll('a').forEach(function(link) {
let href = link.getAttribute('href');
// 站内链接,且没带 /en/
if (href && href.startsWith('/') && !href.startsWith('/en/') && !href.startsWith('http')) {
link.setAttribute('href', '/en' + href);
}
});
}
});