【发布时间】:2010-05-17 09:05:50
【问题描述】:
由于即使在查看 css 或 js 文件时也会触发我的扩展程序的页面加载,所以我想添加另一个检查,仅当当前页面的内容类型为 text/html 时才会触发我的扩展程序。
//eg: at my page load handler
function onPageload(){
// only want to proceed if content-type reflects a text/html or */html page
if ( contentTypeIsHtml() ){
//continue here
}
}
contentTypeIsHtml() 应该做什么?
【问题讨论】:
标签: javascript firefox-addon content-type xpcom