rplus.github.io icon indicating copy to clipboard operation
rplus.github.io copied to clipboard

[POST] CSS visited & 隱私權

Open Rplus opened this issue 10 years ago • 0 comments

利用 CSS 產生的隱私問題 https://blog.gslin.org/archives/2008/08/01/1588/

原本的原理是使用 window.getComputedStyle 去抓各 <a> 的色碼值 藉以判斷是否閱讀過該連結 來(非法)收集 client 端未授權的瀏覽紀錄

不過剛找了下, :visted 這玩意已經有調整過了 不會將 :visted 的樣式曝露在外

另外一點是 :visted 這東西能用的 style 很少 基本上只處理少數的樣式而已

  • color
  • background-color
  • border-color (and its sub-properties)
  • outline-color
  • The color parts of the fill and stroke properties

test: https://jsbin.com/labotix/edit?html,css,js,output

ps: 如果是想轉進 canvas 的話也 sorry 了~ 一樣 GG

可以自己試試~ (Rendering 變色了但是 canvas 吃不到~) https://html2canvas.hertzen.com/examples.html image

相關資料可以參考 MDN

  • Privacy and the :visited selector
    https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector
  • :visited | MDN
    https://developer.mozilla.org/en-US/docs/Web/CSS/:visited

Rplus avatar Feb 14 '16 13:02 Rplus