Javascript 包括不在IE上工作

Javascript 包括不在IE上工作,javascript,internet-explorer-11,browser-extension,crossrider,Javascript,Internet Explorer 11,Browser Extension,Crossrider,我想在我的扩展上创建一个browserAction,当我点击browserAction的图标时,打开一个选项页面(类似于我们在chrome中可以做的)。我创建了代码来完成我所描述的工作,当我点击FF上的图标时,一切正常,页面样式看起来也不错。相反,在IE11上,当我单击图标时,页面显示为没有任何样式 我上传到我的资源,所有我需要的文件,我的options.html,css/style.css和我的图片。这是我的密码 我的background.js如下所示: appAPI.ready(functi

我想在我的扩展上创建一个browserAction,当我点击browserAction的图标时,打开一个选项页面(类似于我们在chrome中可以做的)。我创建了代码来完成我所描述的工作,当我点击FF上的图标时,一切正常,页面样式看起来也不错。相反,在IE11上,当我单击图标时,页面显示为没有任何样式

我上传到我的资源,所有我需要的文件,我的options.html,css/style.css和我的图片。这是我的密码

我的
background.js
如下所示:

appAPI.ready(function($) {

  // Sets the initial browser icon
  appAPI.browserAction.setResourceIcon('48x48.png');

  // Sets the tooltip for the button
  appAPI.browserAction.setTitle('My title');

  // Sets the initial onClick event handler for the button
  appAPI.browserAction.onClick(function(){
  appAPI.openURL({
                resourcePath: "options.html",
                where: "tab",
                focus: true
            });
  });
});
if (document.title == "My options page title") {
  appAPI.resources.includeCSS('css/style.css');
}
我的
extension.js
如下:

appAPI.ready(function($) {

  // Sets the initial browser icon
  appAPI.browserAction.setResourceIcon('48x48.png');

  // Sets the tooltip for the button
  appAPI.browserAction.setTitle('My title');

  // Sets the initial onClick event handler for the button
  appAPI.browserAction.onClick(function(){
  appAPI.openURL({
                resourcePath: "options.html",
                where: "tab",
                focus: true
            });
  });
});
if (document.title == "My options page title") {
  appAPI.resources.includeCSS('css/style.css');
}
上面的代码,根据它的标题检查它是否是我想要的页面(我知道这不是一个好方法,但我现在正在测试…如果你对此有一些建议,我也会很感激)

我做错了什么

@Crossrider支持:我的应用程序id是81180


感谢您的帮助

options.html页面在一个独立的上下文中运行(即extension.js不保证在所有浏览器上运行),因此您应该在html页面中嵌入CSS


[披露:我是一名Crossrider员工]

您是否检查了
文档标题的值,以及
if
语句是否有效?是!我检查了它,甚至我删除了if statament。。。而且它不起作用