├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── assets ├── css │ └── styles.css └── images │ ├── dribble.gif │ ├── logo128.png │ └── logo16.png ├── manifest.json ├── popup.html └── popup.js /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | providedByGatsby@outlook.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## 💥 How to Contribute 2 | 3 | [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/pulls) 4 | 5 | - Take a look at the existing [Issues](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/issues) or [create a new issue](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/issues/new/choose)! 6 | - [Fork the Repo](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/fork). Then, create a branch for any issue that you are working on. Finally, commit your work. 7 | - Create a **[Pull Request](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/compare)** (_PR_), which will be promptly reviewed and given suggestions for improvements by the community. 8 | - Add screenshots or screen captures to your Pull Request to help us understand the effects of the changes proposed in your PR. 9 | 10 | --- 11 | 12 | ## ⭐ HOW TO MAKE A PULL REQUEST: 13 | 14 | **1.** Start by making a Fork of the [**Social-Media-Blocks-Extension**](https://github.com/JavascriptDon/Social-Media-Blocks-Extension) repository. Click on the Fork symbol at the top right corner. 15 | 16 | **2.** Clone your new fork of the repository in the terminal/CLI on your computer with the following command: 17 | 18 | ```bash 19 | git clone https://github.com//Social-Media-Blocks-Extension 20 | ``` 21 | 22 | **3.** Navigate to the newly created Social-Media-Blocks-Extension project directory: 23 | 24 | ```bash 25 | cd Social-Media-Blocks-Extension 26 | ``` 27 | 28 | **4.** Set upstream command: 29 | 30 | ```bash 31 | git remote add upstream https://github.com/JavascriptDon/Social-Media-Blocks-Extension 32 | ``` 33 | 34 | **5.** Create a new branch: 35 | 36 | ```bash 37 | git checkout -b YourBranchName 38 | ``` 39 | 40 | **6.** Sync your fork or your local repository with the origin repository: 41 | 42 | - In your forked repository, click on "Fetch upstream" 43 | - Click "Fetch and merge" 44 | 45 | ### Alternatively, Git CLI way to Sync forked repository with origin repository: 46 | 47 | ```bash 48 | git fetch upstream 49 | ``` 50 | 51 | ```bash 52 | git merge upstream/main 53 | ``` 54 | 55 | ### [Github Docs](https://docs.github.com/en/github/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github) for Syncing 56 | 57 | **7.** Make your changes to the source code. 58 | 59 | **8.** Stage your changes: 60 | 61 | ⚠️ **Make sure** not to commit `package.json` or `package-lock.json` file 62 | 63 | ⚠️ **Make sure** not to run the commands `git add .` or `git add *` 64 | 65 | > Instead, stage your changes for each file/folder 66 | > 67 | > By using public path it means it will add all files and folders under that folder, it is better to be specific 68 | 69 | ```bash 70 | git add public 71 | ``` 72 | 73 | _or_ 74 | 75 | ```bash 76 | git add "" 77 | ``` 78 | 79 | **9.** Commit your changes: 80 | 81 | ```bash 82 | git commit -m "" 83 | ``` 84 | 85 | **10.** Push your local commits to the remote repository: 86 | 87 | ```bash 88 | git push origin YourBranchName 89 | ``` 90 | 91 | **11.** Create a [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)! 92 | 93 | **12.** **Congratulations!** You've made your first contribution to [**Social-Media-Blocks-Extension**](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/graphs/contributors)! 🙌🏼 94 | 95 | **_:trophy: After this, the maintainers will review the PR and will merge it if it helps move the Social-Media-Blocks-Extension project forward. Otherwise, it will be given constructive feedback and suggestions for the changes needed to add the PR to the codebase._** 96 | 97 | --- 98 | 99 | ## 💥 Issues 100 | 101 | In order to discuss changes, you are welcome to [open an issue](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/issues/new/choose) about what you would like to contribute. Enhancements are always encouraged and appreciated. 102 | 103 | ## All the best! 🥇 104 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Helitha Rupasinghe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Social Media Blocks (1.0.3) 2 | === 3 | 4 | - This is a Google Chrome Extension which blocks social media sites like Twitter: Facebook, Instagram, LinkedIn, WhatsApp, Reddit etc.. 5 | - It was initally created from this little snippet found here on [codepen](https://codepen.io/nhatanh17/full/VwwVmLK). 6 | 7 | ![404](https://user-images.githubusercontent.com/101202952/180646836-c7affe54-7709-43b3-bb22-b1c3ed708897.gif) 8 | 9 | ## 👇 Prerequisites 10 | Vite requires Node.js version 14.18+, 16+. 11 | 12 | You will need [Node.js](https://nodejs.org) version 14.18+, 16+ installed on your system. 13 | - This is due to using [Vite](https://vitejs.dev/) 14 | 15 | 16 | ## 🛠️ Setup 17 | 18 | ``` 19 | npm install 20 | ``` 21 | 22 | ### Compiles and hot-reloads for development 23 | ``` 24 | npm run dev 25 | ``` 26 | 27 | ### Compiles and minifies for production 28 | ``` 29 | npm run build 30 | ``` 31 | 32 | ### Locally preview production build 33 | ``` 34 | npm run preview 35 | ``` 36 | 37 | ### Creates necessary build files / assets for building the Chrome extension 38 | ``` 39 | npm run build-extension 40 | ``` 41 | 42 | ## 👨‍💻 Contributing 43 | 44 | Contributions are always welcome... 45 | 46 | - Fork the repository 47 | - Improve current program by 48 | - Improving functionality 49 | - Adding a new feature 50 | - Bug fixes 51 | - Push your work and Create a Pull Request 52 | 53 | ## 🛡️ License 54 | 55 | This project is under the MIT License (MIT). See the LICENSE for more information. 56 | 57 | ## 💪 Thanks to all Contributors 58 | 59 | [![Contributors](https://contrib.rocks/image?repo=JavascriptDon/Social-Media-Blocks-Extension)](https://github.com/JavascriptDon/Social-Media-Blocks-Extension/graphs/contributors) 60 | -------------------------------------------------------------------------------- /assets/css/styles.css: -------------------------------------------------------------------------------- 1 | /*Just here for aesthetics!*/ 2 | html,body{ 3 | font-family: 'Poppins', sans-serif; 4 | font-size: 16px; 5 | margin: 0px; 6 | min-height: 180px; 7 | padding: 0; 8 | width: 384px; 9 | } 10 | 11 | h1{ 12 | font-family: "Open Sans", sans-serif; 13 | font-size: 22px; 14 | font-weight: 400; 15 | margin: 0; 16 | color: #000; 17 | text-align: center; 18 | } 19 | 20 | h3{ 21 | font-size: 15px; 22 | } 23 | 24 | img{ 25 | width: 30px; 26 | } 27 | 28 | p{ 29 | text-align: center; 30 | } 31 | 32 | .modal-header{ 33 | align-items: center; 34 | border-bottom: 0.5px solid #231955; 35 | } 36 | 37 | .modal-content{ 38 | padding: 0 22px; 39 | } 40 | .modal-icons{ 41 | border-top: 0.5px solid #231955; 42 | height: 50px; 43 | width: 100%; 44 | } 45 | 46 | .logo{ 47 | padding: 16px; 48 | } 49 | 50 | .logo-icon{ 51 | vertical-align: text-bottom; 52 | margin-right: 12px; 53 | } 54 | 55 | .version{ 56 | color: #444; 57 | font-size: 18px; 58 | } 59 | 60 | a:link, a:visited{ 61 | color: #231955; 62 | outline: 0; 63 | text-decoration: none; 64 | } 65 | 66 | 67 | .container{ 68 | display: block; 69 | justify-content: space-between; 70 | padding: 10px 22px; 71 | } 72 | 73 | .container a{ 74 | color: #3330E4; 75 | } 76 | 77 | #modal-footer{ 78 | background-color: rgba(0,0,0,0.6); 79 | font-size: 15px; 80 | font-weight: bold; 81 | text-align: center; 82 | margin-top: 180px; 83 | } 84 | 85 | #modal-footer a{ 86 | color: #ffffff; 87 | } -------------------------------------------------------------------------------- /assets/images/dribble.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavascriptDon/Social-Media-Blocks-Extension/52538f6d8e7af3fbbfd0ad2b133370cbd629088a/assets/images/dribble.gif -------------------------------------------------------------------------------- /assets/images/logo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavascriptDon/Social-Media-Blocks-Extension/52538f6d8e7af3fbbfd0ad2b133370cbd629088a/assets/images/logo128.png -------------------------------------------------------------------------------- /assets/images/logo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavascriptDon/Social-Media-Blocks-Extension/52538f6d8e7af3fbbfd0ad2b133370cbd629088a/assets/images/logo16.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 3, 3 | "name": "Social Media Blocks", 4 | "description": "Developers don't talk much. Their code does all the talking. So here's a google chrome extension for developers that want to block big social media websites like Twitter: Facebook, Instagram, LinkedIn, WhatsApp, Reddit etc. Add this extension into your browser and achieve better productivity.", 5 | "version" : "1.0.0", 6 | "icons" : {"128": "./assets/images/logo128.png"}, 7 | "action": { 8 | "default_icon": "./assets/images/logo16.png", 9 | "default_popup": "./popup.html" 10 | }, 11 | "content_scripts": [ 12 | { 13 | "matches": [""], 14 | "js": ["popup.js"] 15 | } 16 | ], 17 | "permissions": ["activeTab"] 18 | } -------------------------------------------------------------------------------- /popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Social Media Blocks 10 | 11 | 12 | 13 | 14 | 19 | 22 | 34 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /popup.js: -------------------------------------------------------------------------------- 1 | const generateHTML = (pageName) => { 2 | return `
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |

404

12 |
13 |
GET BACK TO WORK
14 |
STUDYING > ${pageName}
15 |
16 | 17 |
18 | 19 |
20 | `; 21 | }; 22 | 23 | const generateSTYLING = () => { 24 | return ``; 254 | }; 255 | 256 | switch (window.location.hostname){ 257 | case "www.youtube.com": 258 | document.head.innerHTML = generateSTYLING(); 259 | document.body.innerHTML = generateHTML('YOUTUBE'); 260 | break; 261 | case "www.facebook.com": 262 | document.head.innerHTML = generateSTYLING(); 263 | document.body.innerHTML = generateHTML('FACEBOOK'); 264 | break; 265 | case "web.facebook.com": 266 | document.head.innerHTML = generateSTYLING(); 267 | document.body.innerHTML = generateHTML('FACEBOOK'); 268 | break; 269 | case "www.netflix.com": 270 | document.head.innerHTML = generateSTYLING(); 271 | document.body.innerHTML = generateHTML('NETFLIX'); 272 | break; 273 | case "www.tiktok.com": 274 | document.head.innerHTML = generateSTYLING(); 275 | document.body.innerHTML = generateHTML('TIKTOK'); 276 | break; 277 | case "www.discord.com": 278 | document.head.innerHTML = generateSTYLING(); 279 | document.body.innerHTML = generateHTML('DISCORD'); 280 | break; 281 | case "www.instagram.com": 282 | document.head.innerHTML = generateSTYLING(); 283 | document.body.innerHTML = generateHTML('INSTAGRAM'); 284 | break; 285 | case "web.whatsapp.com": 286 | document.head.innerHTML = generateSTYLING(); 287 | document.body.innerHTML = generateHTML('WHATSAPP'); 288 | break; 289 | case "www.linkedin.com": 290 | document.head.innerHTML = generateSTYLING(); 291 | document.body.innerHTML = generateHTML('LINKEDIN'); 292 | break; 293 | case "www.twitter.com": 294 | document.head.innerHTML = generateSTYLING(); 295 | document.body.innerHTML = generateHTML('TWITTER'); 296 | break; 297 | case "www.reddit.com": 298 | document.head.innerHTML = generateSTYLING(); 299 | document.body.innerHTML = generateHTML('REDDIT'); 300 | break; 301 | }; --------------------------------------------------------------------------------