0
我想在我的扩展中创建一个browserAction,当我点击browserAction的图标时打开一个选项页面(类似我们可以在Chrome中执行的操作)。我创建了代码来完成我所描述的内容,当我点击FF上的图标时,所有工作都正常,页面样式看起来很好。而在IE11上,当我点击图标时,页面显示为没有任何样式。我上传到我的资源,我需要的所有文件,我的options.html,css/style.css和我的图片。这里是我的代码...IncludeCSS在IE上不工作
而且我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
});
});
});
和我extension.js
这样的:
if (document.title == "My options page title") {
appAPI.resources.includeCSS('css/style.css');
}
上面的代码,检查它是否是我想要的网页基于其标题(这不是一个好方法,我知道,但我现在正在测试...如果你有一些建议,我也会欣赏)
我在做什么G?
@Crossrider支持:我的应用程序ID是81180个
感谢您的帮助
你检查document.title'的'的价值,你确定了'if'语句工作? – Louy
是的!我检查了它,即使我删除了if statament ...并且它不起作用 – hdlopez