TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN : Chrome 6 and 7 getComputedStyle(el,prop) is lying, did anyone notice?

1 点作者 chrismeyer_超过 14 年前
If you try to ask a property like color : getComputedStyle(element,"color") through javascript, for a know HTML element of your page the browser will lie and never tell you the real displayed color.

1 comment

_delirium超过 14 年前
Chrome is following Mozilla's change on this point, which was designed to solve the longstanding CSS history leakage problem, where a page could use computed styles to slurp your browsing history: <a href="http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/" rel="nofollow">http://blog.mozilla.com/security/2010/03/31/plugging-the-css...</a><p>Is it lying for <i>all</i> elements, though? It should only really be lying about the "visited" styling of links or sub-elements of links (it'll return the computed style as if they were unvisited).
评论 #1682005 未加载