我正在尝试为网站制作主题。所以我设置了Chrome扩展程序,
这是清单:
{
"manifest_version": 2,
"name": "Beard's Material Discord theme for chrome",
"version": "1.3.5",
"description": "an extension to make discord more material",
"background": {
"scripts": ["background.js"],
"persistent": true
},
"content_scripts": [ {
"css": ["styles.css"],
"matches": ["https://discordapp.com/*"]
} ]
}
这是background.js
chrome.runtime.onInstalled.addListener(function (object) {
chromez.tabs.create({url: "http://gonova.gq/beardstheme"}, function (tab) {
console.log("New tab launched with http://gonova.gq/beardstheme");
});
});
这是styles.css
@import url('https://rawgit.com/BeardDesign1/Material-design-theme-ressources/master/code-files/update/version.css');
所以这就是问题所在。当我从“https://rawgit.com/BeardDesign1/Material-design-theme-ressources/master/code-files/update/version.css”粘贴css时,扩展程序完全有效。但是当我使用@import命令时,没有任何事情发生。
这是因为Chrome不允许这样做吗?或者我完全错了。