mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-03-13 11:44:12 +01:00
Changed preferencePane styling to self hosted module.
This commit is contained in:
parent
3bcdbc23ac
commit
9676f3f5b1
Binary file not shown.
16
data/options.css
Normal file
16
data/options.css
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
setting[pref-name="showNotifications"] {
|
||||||
|
border-bottom: 0px transparent none;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
}
|
||||||
|
setting[pref-name="ignoreList"]{
|
||||||
|
border-top: 0px transparent none;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
setting[pref-name="showCallingFile"]{
|
||||||
|
border-bottom: 0px transparent none;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
}
|
||||||
|
setting[pref-name="showCompleteCallingStack"]{
|
||||||
|
border-top: 0px transparent none;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
(function(){
|
(function(){
|
||||||
"use strict";
|
"use strict";
|
||||||
|
require("./stylePreferencePane.js");
|
||||||
|
|
||||||
var self = require("sdk/self");
|
var self = require("sdk/self");
|
||||||
var pageMod = require("sdk/page-mod");
|
var pageMod = require("sdk/page-mod");
|
||||||
|
33
lib/stylePreferencePane.js
Normal file
33
lib/stylePreferencePane.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
(function(){
|
||||||
|
"use strict";
|
||||||
|
const { Cu } = require('chrome');
|
||||||
|
const { on } = require('sdk/system/events');
|
||||||
|
const self = require('sdk/self');
|
||||||
|
const { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||||
|
const { setTimeout } = require("sdk/timers");
|
||||||
|
const { loadSheet } = require("sdk/stylesheet/utils");
|
||||||
|
AddonManager.getAddonByID(self.id, function(addon){
|
||||||
|
on('addon-options-displayed', onAddonOptionsDisplayed, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
function onAddonOptionsDisplayed({ subject: doc, data }) {
|
||||||
|
if (data === self.id) {
|
||||||
|
loadSheet(doc.defaultView, self.data.url("options.css"));
|
||||||
|
|
||||||
|
// need to wait unttil the simple-prefs are inserted in the DOM
|
||||||
|
setTimeout(function(){
|
||||||
|
// replace empty menuitems with separators
|
||||||
|
[].slice.call(doc.querySelectorAll("menuitem[value='']")).forEach(
|
||||||
|
function(menuitem){
|
||||||
|
var separator = doc.createElement("menuseparator");
|
||||||
|
menuitem.parentNode.replaceChild(separator, menuitem);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}());
|
12
package.json
12
package.json
@ -70,29 +70,25 @@
|
|||||||
"name": "showNotifications",
|
"name": "showNotifications",
|
||||||
"title": "Show notifications",
|
"title": "Show notifications",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"value": true,
|
"value": true
|
||||||
"style": "border-bottom: 0px transparent none; padding-top: 0.5em;"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ignoreList",
|
"name": "ignoreList",
|
||||||
"title": "Ignore list",
|
"title": "Ignore list",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "",
|
"value": ""
|
||||||
"style": "border-top: 0px transparent none; padding-bottom: 0.5em;"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "showCallingFile",
|
"name": "showCallingFile",
|
||||||
"title": "Display calling file",
|
"title": "Display calling file",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"value": false,
|
"value": false
|
||||||
"style": "border-bottom: 0px transparent none; padding-top: 0.5em;"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "showCompleteCallingStack",
|
"name": "showCompleteCallingStack",
|
||||||
"title": "Display complete calling stack",
|
"title": "Display complete calling stack",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"value": false,
|
"value": false
|
||||||
"style": "border-top: 0px transparent none; padding-bottom: 0.5em;"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "allowPDFCanvas",
|
"name": "allowPDFCanvas",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user