generate extension from master list

pull/23/head
Paul Butler 7 years ago
parent 49015240ee
commit 8f2149e3a5

@ -1,10 +1,13 @@
all : all_blacklists BarbBlock.txt
all : all_blacklists BarbBlock.txt package
blacklists/% : src/generate_blacklist.py blacklist.yaml templates/%.tmpl
blacklists/%.txt : src/generate_blacklist.py blacklist.yaml templates/%.txt.tmpl
python $^ $@
package :
extension/% : src/generate_blacklist.py blacklist.yaml templates/extension-%.tmpl
python $^ $@
package : extension/manifest.json extension/barbblock.js
cd extension; zip barbblock.zip -r ./ -x *.git*
mv extension/barbblock.zip ./

@ -1,22 +1,33 @@
var urls = [
'*://functionalclam.com/*', // Issue #1
'*://functionalclam.com/*',
'*://2znp09oa.com/*',
'*://4jnzhl0d0.com/*',
'*://6ldu6qa.com/*',
'*://82o9v830.com/*',
'*://abandonedclover.com/*',
'*://abruptroad.com/*',
'*://actuallysheep.com/*',
'*://ak0gsh40.com/*',
'*://ambitiousagreement.com/*',
'*://anxiousapples.com/*',
'*://argyresthia.com/*',
'*://awzbijw.com/*',
'*://balloontexture.com/*',
'*://baskettexture.com/*',
'*://bawdybeast.com/*',
'*://beamincrease.com/*',
'*://beamkite.com/*',
'*://boilingbeetle.com/*',
'*://boredcrown.com/*',
'*://brassrule.com/*',
'*://broadboundary.com/*',
'*://broadcastbed.com/*',
'*://calmfoot.com/*',
'*://cherrythread.com/*',
'*://chiefcurrent.com/*',
'*://chinchickens.com/*',
'*://comfortablecheese.com/*',
'*://commandwalk.com/*',
'*://concernrain.com/*',
'*://consciouscabbage.com/*',
@ -47,12 +58,16 @@ var urls = [
'*://giddycoat.com/*',
'*://gorgeousground.com/*',
'*://greetzebra.com/*',
'*://greyinstrument.com/*',
'*://guardedgovernor.com/*',
'*://guitarbelieve.com/*',
'*://h78xb.pw/*',
'*://hfc195b.com/*',
'*://hilariouszinc.com/*',
'*://illustriousoatmeal.com/*',
'*://incrediblesugar.com/*',
'*://ivykiosk.com/*',
'*://j93557g.com/*',
'*://jewelcheese.com/*',
'*://karisimbi.net/*',
'*://limpingline.com/*',
@ -62,6 +77,7 @@ var urls = [
'*://lp3tdqle.com/*',
'*://lumpyleaf.com/*',
'*://matchcows.com/*',
'*://messagenovice.com/*',
'*://mixedreading.com/*',
'*://mowfruit.com/*',
'*://ovalpigs.com/*',
@ -76,7 +92,9 @@ var urls = [
'*://quaintcan.com/*',
'*://quicksandear.com/*',
'*://readgoldfish.com/*',
'*://rebelsubway.com/*',
'*://receptiveink.com/*',
'*://resolutekey.com/*',
'*://rulerabbit.com/*',
'*://saysidewalk.com/*',
'*://scarcestream.com/*',
@ -113,36 +131,18 @@ var urls = [
'*://tracedesire.com/*',
'*://trickycelery.com/*',
'*://tritetongue.com/*',
'*://truckstomatoes.com/*',
'*://unknowntray.com/*',
'*://unusualtitle.com/*',
'*://voicevegetable.com/*',
'*://h78xb.pw/*',
'*://2znp09oa.com/*',
'*://4jnzhl0d0.com/*',
'*://6ldu6qa.com/*',
'*://82o9v830.com/*',
'*://ak0gsh40.com/*',
'*://argyresthia.com/*',
'*://awzbijw.com/*',
'*://balloontexture.com/*',
'*://boredcrown.com/*',
'*://broadcastbed.com/*',
'*://comfortablecheese.com/*',
'*://greyinstrument.com/*',
'*://hfc195b.com/*',
'*://j93557g.com/*',
'*://messagenovice.com/*',
'*://rebelsubway.com/*',
'*://resolutekey.com/*',
'*://truckstomatoes.com/*',
'*://wateryvan.com/*',
'*://wirecomic.com/*',
'*://xovq5nemr.com/*',
'*://zbwp6ghm.com/*',
'*://zbwp6ghm.com/*'
];
chrome.webRequest.onBeforeRequest.addListener(
(details) => ({cancel: true}),
{urls: urls},
["blocking"]
);
);

@ -1,8 +1,8 @@
{
"manifest_version": 2,
"name": "BarbBlock",
"description": "Blocks requests to sites which have used DMCA takedowns to force removal from other blacklists.",
"version": "1.0",
"description": "Blocks requests to sites which have used legal threats to remove themselves from other blacklists.",
"version": "1.1",
"icons": {
"16": "icon/icon16.png",
"32": "icon/icon32.png",

@ -2,6 +2,7 @@ import argparse
import os
import yaml
import jinja2
@ -10,6 +11,9 @@ def run_template_engine(blacklist_file, template_file, output_file):
with open(blacklist_file) as bf:
context = yaml.load(bf)
context['domains'] = [d for blockset in context['blacklist']
for d in blockset['domains']]
result = jinja2.Environment(
loader=jinja2.FileSystemLoader(template_path or './')

@ -1,2 +1,2 @@
{% for blockset in blacklist %}{% for domain in blockset.domains %}{{ domain }}
{% endfor %}{% endfor %}
{% for domain in domains %}{{ domain }}
{% endfor %}

@ -0,0 +1,10 @@
var urls = [
{% for domain in domains %} '*://{{ domain }}/*'{% if not loop.last %},{% endif %}
{% endfor %}];
chrome.webRequest.onBeforeRequest.addListener(
(details) => ({cancel: true}),
{urls: urls},
["blocking"]
);

@ -0,0 +1,22 @@
{
"manifest_version": 2,
"name": "{{ name }}",
"description": "{{ description }}",
"version": "{{ version }}",
"icons": {
"16": "icon/icon16.png",
"32": "icon/icon32.png",
"48": "icon/icon48.png",
"128": "icon/icon128.png"
},
"background": {
"scripts": [
"barbblock.js"
]
},
"permissions": [
"webRequest",
"webRequestBlocking",
"<all_urls>"
]
}
Loading…
Cancel
Save