因为即使我查看 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() 应该做什么?