var targetCss= document.createProcessingInstruction('xml-stylesheet', 'href="chrome://browser/content/cssTest/boxStyle.css" type="text/css"'); document.insertBefore(targetCss,document.documentElement); 用js引入样式表