5
我正在構建Firefox擴展。它將CSS注入一個網站。但我想根據用戶的喜好注入它。這是我的附加中最重要的部分:使用Firefox插件中的用戶首選項
exports.main = function() {
var pageMod = require("page-mod");
var test = require("preferences-service");
pageMod.PageMod({
include: "http://example.org/*",
contentStyle: "something here"
});
};
但有在Mozilla Firefox錯誤控制檯的錯誤:
Error: Module: undefined located at undefined has no authority to load: preferences-service
而且我不知道我應該做的,使其工作。有沒有人有任何想法? :)也許還有其他的方法?
其實,我想讀取偏好設置,然後生成足夠的樣式。我有defaults/preferences/prefs.js中的用戶首選項,如果這是有用的信息。