在七年半前 (2008 年八月) 寫的「 利用 css 產(chǎn)生的隱私問題」文章,最近好像是因為 rplus chen在 facebook上的 這邊提到而又有不少點(diǎn)擊進(jìn)來,不過這個問題在 2010 年左右已經(jīng)被解決了。
可以參考 MDN上「 :visited - CSS」的說明,以及當(dāng)時 Mozilla所發(fā)佈的文章:「 privacy-related changes coming to CSS :visited」。
由於隱私問題,Mozilla 的作法是限制 :visited可以改變的項目,只剩下少數(shù)與呈現(xiàn)方式有關(guān)的屬性可以用:
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 資訊的方法,也會以沒有瀏覽過該網(wǎng)站重新計算,並且傳回假資料以確保還是不會洩漏:
立即學(xué)習(xí)“前端免費(fèi)學(xué)習(xí)筆記(深入)”;
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怎么學(xué)習(xí)?HTML怎么入門?HTML在哪學(xué)?HTML怎么學(xué)才快?不用擔(dān)心,這里為大家提供了HTML速學(xué)教程(入門課程),有需要的小伙伴保存下載就能學(xué)習(xí)啦!
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號