如何以编程方式从 IE WebBrowser (IHTMLDocument2) 获取已使用的 css 图像列表

发布于 2024-11-30 06:58:35 字数 258 浏览 4 评论 0原文

通过迭代IHTMLDocument2的IHTMLStyleSheetsCollection、IHTMLStyleSheet、IHTMLStyleSheetRulesCollection等来获取当前文档中所有样式的列表是相对直接的。

关于如何获取文档中仅使用的样式列表有什么想法吗?更准确地说,我正在寻找如何找出文档中使用了 css 文件中的哪些图像。

有一个程序表示,如果安装了 IE8/IE9,它可以执行此操作(确定正在使用哪些 css 图像)。

谢谢

It is relatively straight forward to iterate through IHTMLStyleSheetsCollection, IHTMLStyleSheet, IHTMLStyleSheetRulesCollection etc. of IHTMLDocument2 to obtain list of all styles in current document.

Any ideas on how to get a list of only used styles in the document? And to be more precise, I am looking for how to find out which images from the css files are being used in the document.

There is a program that says it is able to do this (determine which css images are being used) if IE8/IE9 is installed.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们只是彼此的过ke 2024-12-07 06:58:35

好吧,我找到了这个问题的答案:

最近的浏览器版本(FF 3.5,IE 8)已经实现了一个 querySelector 方法,可以用来查询页面上是否使用了选择器。

请参阅:https://developer.mozilla.org/En/DOM/Document.querySelector 了解更多信息。

Ok I have found an answer to this:

Recent browser versions (FF 3.5, IE 8) have implemented a querySelector method that can be used to query if a selector is used on a page.

see: https://developer.mozilla.org/En/DOM/Document.querySelector for more info.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文