如何以编程方式从 IE WebBrowser (IHTMLDocument2) 获取已使用的 css 图像列表
通过迭代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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我找到了这个问题的答案:
最近的浏览器版本(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.