mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Removed obsolete files.
This commit is contained in:
parent
fdf71f304f
commit
0234a6d8cf
11
.jpmignore
11
.jpmignore
@ -1,11 +0,0 @@
|
||||
*.svg
|
||||
*.png
|
||||
*.xpi
|
||||
*.zip
|
||||
.*
|
||||
*.txt
|
||||
!releaseNotes.txt
|
||||
*.md
|
||||
test/
|
||||
addon description/
|
||||
doc/
|
BIN
AllowIcon.png
BIN
AllowIcon.png
Binary file not shown.
Before Width: | Height: | Size: 7.7 KiB |
BIN
AskIcon.png
BIN
AskIcon.png
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
@ -1,42 +0,0 @@
|
||||
setting[pref-name="rng"] {
|
||||
border-bottom: 0px transparent none;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
setting[pref-name="storePersistentRnd"]{
|
||||
border-top: 0px transparent none;
|
||||
border-bottom: 0px transparent none;
|
||||
}
|
||||
setting[pref-name="persistentRndStorage"]{
|
||||
border-top: 0px transparent none;
|
||||
border-bottom: 0px transparent none;
|
||||
display: none;
|
||||
}
|
||||
setting[pref-name="clearPersistentRnd"]{
|
||||
border-top: 0px transparent none;
|
||||
border-bottom: 0px transparent none;
|
||||
}
|
||||
|
||||
setting[pref-name="showNotifications"] {
|
||||
border-bottom: 0px transparent none;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
setting[pref-name="notificationDisplayTime"]{
|
||||
border-top: 0px transparent none;
|
||||
border-bottom: 0px transparent none;
|
||||
}
|
||||
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;
|
||||
}
|
||||
setting[pref-name="stackList"]{
|
||||
border-top: 0px transparent none;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
/* jslint moz: true */
|
||||
/* 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";
|
||||
|
||||
var URL = require("sdk/url").URL;
|
||||
const {parseErrorStack} = require("./callingStack");
|
||||
const {setTimeout, clearTimeout} = require("sdk/timers");
|
||||
|
||||
var tabUtils = require("sdk/tabs/utils");
|
||||
exports.notify = function({url, errorStack, messageId}, {lists, notificationPref, _, browser, window}){
|
||||
|
||||
var callingStackMsg = parseErrorStack(errorStack);
|
||||
|
||||
var contentURL = new URL(url);
|
||||
if (notificationPref.doShow() && !lists.get("ignore").match(contentURL)){
|
||||
url = contentURL.href;
|
||||
var domain = contentURL.hostname;
|
||||
var message = _(messageId).replace(/\{url\}/g, domain || url);
|
||||
|
||||
var tab, tabBrowser;
|
||||
if (browser){
|
||||
window = tabUtils.getOwnerWindow(browser);
|
||||
if (!window){
|
||||
return;
|
||||
}
|
||||
tab = tabUtils.getTabForBrowser(browser);
|
||||
if (!tab){
|
||||
// page ist displayed in preview
|
||||
return;
|
||||
}
|
||||
tabBrowser = tabUtils.getTabBrowser(window);
|
||||
}
|
||||
else if (window){
|
||||
tab = tabUtils.getTabForContentWindow(window);
|
||||
tabBrowser = tabUtils.getTabBrowserForTab(tab);
|
||||
browser = tabUtils.getBrowserForTab(tab);
|
||||
}
|
||||
|
||||
var notifyBox = tabBrowser.getNotificationBox(browser);
|
||||
var notification = notifyBox.getNotificationWithValue("CanvasBlocker-" + messageId);
|
||||
if (notification){
|
||||
notification.label = message;
|
||||
clearTimeout(notification.hideTimeout);
|
||||
}
|
||||
else {
|
||||
var buttons = [
|
||||
{
|
||||
label: _("displayFullURL"),
|
||||
accessKey: "",
|
||||
callback: function(){
|
||||
window.alert(notification.url);
|
||||
// only way to prevent closing... see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/appendNotification#Notification_box_events
|
||||
throw new Error("Do not close notification.");
|
||||
}
|
||||
},
|
||||
{
|
||||
label: _("displayCallingStack"),
|
||||
accessKey: "",
|
||||
callback: function(){
|
||||
window.alert(notification.callingStackMsg);
|
||||
// only way to prevent closing... see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/appendNotification#Notification_box_events
|
||||
throw new Error("Do not close notification.");
|
||||
}
|
||||
},
|
||||
{
|
||||
label: _("ignorelistDomain"),
|
||||
accessKey: "",
|
||||
callback: function(){
|
||||
var domain = window.prompt(
|
||||
_("inputIgnoreDomain"),
|
||||
notification.domain
|
||||
);
|
||||
if (domain){
|
||||
lists.appendTo("ignore", domain);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: _("whitelistURL"),
|
||||
accessKey: "",
|
||||
callback: function(){
|
||||
var url = window.prompt(
|
||||
_("inputWhitelistDomain"),
|
||||
"^" + notification.url.replace(/([\\\+\*\?\[\^\]\$\(\)\{\}\=\!\|\.])/g, "\\$1") + "$"
|
||||
);
|
||||
if (url){
|
||||
lists.appendTo("white", url);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: _("whitelistDomain"),
|
||||
accessKey: "",
|
||||
callback: function(){
|
||||
var domain = window.prompt(
|
||||
_("inputWhitelistURL"),
|
||||
notification.domain
|
||||
);
|
||||
if (domain){
|
||||
lists.appendTo("white", domain);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
label: _("disableNotifications"),
|
||||
accessKey: "",
|
||||
callback: function(){
|
||||
notificationPref.setShow(false);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
var priority = notifyBox.PRIORITY_WARNING_MEDIUM;
|
||||
notification = notifyBox.appendNotification(
|
||||
message,
|
||||
"CanvasBlocker-" + messageId,
|
||||
"chrome://browser/skin/Info.png",
|
||||
priority,
|
||||
buttons
|
||||
);
|
||||
}
|
||||
notification.url = url;
|
||||
notification.domain = domain;
|
||||
notification.callingStackMsg = callingStackMsg;
|
||||
var displayTime = notificationPref.displayTime();
|
||||
if (displayTime){
|
||||
notification.hideTimeout = setTimeout(function(){
|
||||
try {
|
||||
notification.close();
|
||||
}
|
||||
catch(e){
|
||||
// tab is not in focus
|
||||
}
|
||||
}, displayTime * 1000);
|
||||
}
|
||||
|
||||
return notification;
|
||||
}
|
||||
};
|
||||
}());
|
@ -1,34 +0,0 @@
|
||||
/* jslint moz: true */
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
|
||||
}());
|
@ -1,27 +0,0 @@
|
||||
/* jslint moz: true */
|
||||
/* 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(){
|
||||
const webExtension = require("sdk/webextension");
|
||||
const preferences = require("sdk/simple-prefs");
|
||||
const prefs = preferences.prefs;
|
||||
// console.log("starting webExtension");
|
||||
webExtension.startup().then(function(api){
|
||||
api.browser.runtime.onConnect.addListener(function(port){
|
||||
var prefNames = Object.keys(prefs);
|
||||
// console.log("syncing prefs", prefNames);
|
||||
prefNames.forEach(function(name){
|
||||
if (!name.startsWith("sdk.")){
|
||||
var obj = {};
|
||||
obj[name] = prefs[name];
|
||||
port.postMessage(obj);
|
||||
preferences.on(name, function(){
|
||||
obj[name] = prefs[name];
|
||||
port.postMessage(obj);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
@ -1,18 +0,0 @@
|
||||
/* jslint moz: true */
|
||||
/* 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";
|
||||
|
||||
browser.storage.local.set({
|
||||
storageVersion: 0.1
|
||||
});
|
||||
|
||||
var port = browser.runtime.connect();
|
||||
port.onMessage.addListener(function(data){
|
||||
if (data){
|
||||
browser.storage.local.set(data);
|
||||
}
|
||||
});
|
||||
}());
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "embeddedCanvasBlocker@kkapsner.de",
|
||||
"version": "0.1",
|
||||
"background": {
|
||||
"scripts": ["background.js"]
|
||||
},
|
||||
"permissions": [
|
||||
"storage"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user