在七年半前 (2008 年八月) 寫的「 利用 css 產生的隱私問題」文章,最近好像是因為 rplus chen在 facebook上的 這邊提到而又有不少點擊進來,不過這個問題在 2010 年左右已經被解決了。
可以參考 MDN上「 :visited - CSS」的說明,以及當時 Mozilla所發佈的文章:「 privacy-related changes coming to CSS :visited」。
由於隱私問題,Mozilla 的作法是限制 :visited可以改變的項目,只剩下少數與呈現方式有關的屬性可以用:
For privacy reasons, browsers strictly limit the styles you can apply using an element selected by this pseudo-class: only color, background-color, border-color, border-bottom-color, border-left-color, border-right-color, border-top-color, outline-color, column-rule-color, filland stroke.
另外各種想要取得 :visited的 CSS 資訊的方法,也會以沒有瀏覽過該網站重新計算,並且傳回假資料以確保還是不會洩漏:
立即学习“前端免费学习笔记(深入)”;
The first change is that Gecko will lie to web applications under certain circumstances. In particular, getComputedStyle()and similar functions such as element.querySelector()always return values indicating that a user has never visited any of the links on a page.
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号