Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtskydJ committed May 11, 2019
0 parents commit f29e757
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
del dist.xpi
pushd .\src
"C:\Program Files\7-Zip\7z.exe" a ..\dist.xpi
popd
Binary file added dist.xpi
Binary file not shown.
31 changes: 31 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Abortion is Infanticide (Firefox Add-On)
========================================

Add this extension to Firefox, and the word "abortion" will be replaced with the word "infanticide" in all your websites.

### Credit

Original code by [m59](https://github.com/m59peacemaker).
He used the word "murder".
I am using the word "infanticide", because I think it more closely captures what abortion is.
(Murder covers all ages, whereas infanticide covers a smaller age range.)

Also, if you read an article, and you see that someone does not want to outlaw murder, you might get confused.
But if you see the word "infanticide", then hopefully you will not get confused, and you will remember this extension.

As a slight bonus, I don't need to replace a/an.

The only downside I see is that "infancide" might not evoke as strong of emotions.
(That's the reason to switch away from the term "abortion". It likely does not evoke as strong of emotions as the word "murder".)

### Build

To build, follow these steps:

1. Open `abortion-is-infanticide-ff-addon/src`
2. Select all files/folders, Right-Click, and choose `Send to > Compressed (zipped) folder)`
3. Rename from `whatever.zip` to `whatever.xpi`

### License

[MIT](https://choosealicense.com/licenses/mit/)
Binary file added src/abortion-is-infanticide-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/abortion-is-infanticide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(function (doc) {

var isTextNode = function itn(node) {
return node.nodeName === '#text'
}

var changeAbortionToInfanticide = function cati(text) {
return text.replace(/(abortion)(ist)?/ig, (_, abortion) => {
return `${abortion[0] === 'A' ? 'I' : 'i'}nfanticide`
})
}

Array.from(doc.querySelectorAll('*')).forEach(el => {
return Array.from(el.childNodes)
.filter(isTextNode)
.forEach(node => node.textContent = changeAbortionToInfanticide(node.textContent))
})

})(document)
15 changes: 15 additions & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"description": "Replaces the word \"Abortion\" with the word \"Infanticide\" on all your websites",
"manifest_version": 2,
"name": "Abortion is Infanticide",
"version": "1.0.0",
"author": "Joseph Dykstra",
"homepage_url": "https://github.com/ArtskydJ/abortion-is-infanticide-ff-addon",
"icons": {
"48": "abortion-is-infanticide-48.png"
},
"content_scripts": [{
"matches": ["*://*/"],
"js": ["abortion-is-infanticide.js"]
}]
}

0 comments on commit f29e757

Please sign in to comment.