diff --git a/README.md b/README.md index da23039..ade2eb6 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Features can be toggled on or off in the extension menu. * Insert random key presses * Redirect to a random translation * Focus and scroll to random elements on the page +* Every x clicks takes you to a charity of choice page # Ideas @@ -40,5 +41,4 @@ Features can be toggled on or off in the extension menu. * Change font randomly * White noise at 5% volume * Whenever they open a new tab, open a new browser window -* Every x clicks takes you to a charity of choice page * Play a fart sound whenever they activate their mic in a meeting diff --git a/extension/plugins/content/GoToCharity.js b/extension/plugins/content/GoToCharity.js new file mode 100644 index 0000000..e702e88 --- /dev/null +++ b/extension/plugins/content/GoToCharity.js @@ -0,0 +1,48 @@ +import ContentPlugin from '../../lib/ContentPlugin.js'; + +class GoToCharity extends ContentPlugin { + constructor() { + super('After 3 click opens a charity in a new tab'); + } + + id = 'ad761a01-f3f1-4c80-b9ec-7f033be7c867'; + settings = { + enabled: false, + }; + + + run() { +var charitiesLinks = [ + 'https://www.globalgiving.org/projects/send-vulnerable-filipino-children-to-school/', + 'https://www.globalgiving.org/projects/team21108/', + 'https://www.globalgiving.org/projects/your-gift-delivers-gratefulrecovery-to-18-men/', + 'https://www.globalgiving.org/projects/will-benefit-75-pupils-of-apedi-and-angic-p-s-1/', + 'https://www.globalgiving.org/projects/provide-urgent-medical-attention-to-syrians/', + 'https://globalgiving.org/projects/educate-a-girl-educate-a-nation-sierra-leone/', + 'https://www.globalgiving.org/projects/keepthedream-empowering-children-as-leaders-of-tomorrow/', + 'https://www.globalgiving.org/projects/relief-to-coronavirus-affected-families/', + 'https://www.globalgiving.org/projects/janani-home-girls/', + 'https://www.globalgiving.org/projects/ukraine-crisis-relief-fund/', + 'https://www.globalgiving.org/projects/forests-4-water/', + 'https://www.globalgiving.org/projects/girls-health-and-hygiene-in-india/', + 'https://www.globalgiving.org/projects/animalcareonwheels-jct-ahd/', + 'https://globalgiving.org/projects/plant-20-000-trees-in-northern-rwanda/', + ] + +var count = 0; + document.addEventListener("click", (e) => { + count++; + if(count % 3 === 0){ + var _sortedLink = charitiesLinks[Math.floor(Math.random() * charitiesLinks.length-1)]; + window.open(_sortedLink, "_blank"); + count ==0; + } + }); + } + + cleanup() { + + } +} + +export default GoToCharity; diff --git a/extension/plugins/index.js b/extension/plugins/index.js index f9e74c2..b834163 100644 --- a/extension/plugins/index.js +++ b/extension/plugins/index.js @@ -13,6 +13,7 @@ import ReplaceWordsWithMisspellings from './content/ReplaceWordsWithMisspellings import RandomElementFocus from './content/RandomElementFocus.js'; import KeyRepeat from './content/KeyRepeat.js'; import HideCursorRandomly from './content/HideCursorRandomly.js'; +import GoToCharity from './content/GoToCharity.js'; import RedirectToRandomTranslation from './content/RedirectToRandomTranslation.js'; export default [ @@ -31,5 +32,6 @@ export default [ new RandomElementFocus(), new KeyRepeat(), new HideCursorRandomly(), + new GoToCharity(), new RedirectToRandomTranslation(), ];