1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 21:00:23 +01:00

First integration of the webextension.

This commit is contained in:
kkapsner 2016-12-20 23:55:45 +01:00
parent 6748771402
commit 25b0d400be
9 changed files with 69 additions and 1 deletions

View File

@ -9,3 +9,4 @@
test/
addon description/
doc/
!webextension/icons/*

View File

@ -16,6 +16,12 @@
const preferences = require("sdk/simple-prefs");
const prefService = require("sdk/preferences/service");
const prefs = preferences.prefs;
const webExtension = require("sdk/webextension");
webExtension.startup().then(function(api){
const {browser} = api;
// browser.runtime.onMessage.addListener(handleMessage);
}
);
const notificationPref = {
doShow: function(){

View File

@ -11,6 +11,7 @@
"keywords": "privacy, canvas, fingerprinting",
"description": "Changes the JS-API for modifying <canvas> to prevent Canvas-Fingerprinting.",
"homepage": "https://github.com/kkapsner/CanvasBlocker/",
"hasEmbeddedWebExtension": true,
"preferences": [
{
"name": "whiteList",

View File

@ -0,0 +1,16 @@
console.log("background");
browser.tabs.query({}).then(function(tabs){
console.log("tabs", tabs);
tabs.forEach(function(tab){
console.log("tab", tab);
browser.pageAction.show(tab.id).then(function(){console.log("success");}, function(){console.log("error");});
});
});
browser.tabs.onActivated.addListener(function(tab){
browser.pageAction.show(tab.id);
});
browser.tabs.onUpdate.addistener(function(tab){
browser.pageAction.show(tab.id);
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,30 @@
{
"background": {
"scripts": ["background.js"]
},
"permissions": [
"activeTab",
"tabs"
],
"page_action": {
"browser_style": true,
"default_icon": {
"19": "icons/printed19.png",
"38": "icons/printed38.png"
},
"default_popup": "pageAction/index.html"
},
"applications": {
"gecko": {
"id": "CanvasBlocker-WebExtension@kkapsner.de",
"strict_min_version": "51.0",
"strict_max_version": "60.*"
}
},
"description": "Embeded WebExtension for the CanvasBlocker.",
"name": "CanvasBlocker-WebExtension",
"version": "1.0",
"manifest_version": 2
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Fingerprinted</title>
</head>
<body>
<h1>Test</h1>
How does this display?
<script src="index.js"></script>
</body>
</html>

View File

@ -0,0 +1,3 @@
(function(){
document.body.appendChild(document.createTextElement("JS generated!"));
}());