mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 18:42:00 +01:00
First integration of the webextension.
This commit is contained in:
parent
6748771402
commit
25b0d400be
@ -9,3 +9,4 @@
|
|||||||
test/
|
test/
|
||||||
addon description/
|
addon description/
|
||||||
doc/
|
doc/
|
||||||
|
!webextension/icons/*
|
@ -16,6 +16,12 @@
|
|||||||
const preferences = require("sdk/simple-prefs");
|
const preferences = require("sdk/simple-prefs");
|
||||||
const prefService = require("sdk/preferences/service");
|
const prefService = require("sdk/preferences/service");
|
||||||
const prefs = preferences.prefs;
|
const prefs = preferences.prefs;
|
||||||
|
const webExtension = require("sdk/webextension");
|
||||||
|
webExtension.startup().then(function(api){
|
||||||
|
const {browser} = api;
|
||||||
|
// browser.runtime.onMessage.addListener(handleMessage);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const notificationPref = {
|
const notificationPref = {
|
||||||
doShow: function(){
|
doShow: function(){
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"keywords": "privacy, canvas, fingerprinting",
|
"keywords": "privacy, canvas, fingerprinting",
|
||||||
"description": "Changes the JS-API for modifying <canvas> to prevent Canvas-Fingerprinting.",
|
"description": "Changes the JS-API for modifying <canvas> to prevent Canvas-Fingerprinting.",
|
||||||
"homepage": "https://github.com/kkapsner/CanvasBlocker/",
|
"homepage": "https://github.com/kkapsner/CanvasBlocker/",
|
||||||
|
"hasEmbeddedWebExtension": true,
|
||||||
"preferences": [
|
"preferences": [
|
||||||
{
|
{
|
||||||
"name": "whiteList",
|
"name": "whiteList",
|
||||||
|
16
webextension/background.js
Normal file
16
webextension/background.js
Normal 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);
|
||||||
|
});
|
||||||
|
|
BIN
webextension/icons/printed19.png
Normal file
BIN
webextension/icons/printed19.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
webextension/icons/printed38.png
Normal file
BIN
webextension/icons/printed38.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
30
webextension/manifest.json
Normal file
30
webextension/manifest.json
Normal 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
|
||||||
|
}
|
11
webextension/pageAction/index.html
Normal file
11
webextension/pageAction/index.html
Normal 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>
|
3
webextension/pageAction/index.js
Normal file
3
webextension/pageAction/index.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
(function(){
|
||||||
|
document.body.appendChild(document.createTextElement("JS generated!"));
|
||||||
|
}());
|
Loading…
x
Reference in New Issue
Block a user