您好,欢迎访问一九零五行业门户网

關於 CSS 中 :visited 的隱私問題_html/css_WEB-ITnose

在七年半前 (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.
其它类似信息

推荐信息