Skip to content

Commit

Permalink
Merge pull request #16 from nomandhoni-cs/main
Browse files Browse the repository at this point in the history
Releasing v0.3.0 [ Stable Release ]
  • Loading branch information
nomandhoni-cs authored Oct 21, 2023
2 parents d3ef746 + 1954ec1 commit e46181b
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 38 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
26 changes: 26 additions & 0 deletions .github/workflows/main_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Bump version
on:
pull_request:
types:
- closed
branches:
- main

jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'

- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
WITH_V: true
PRERELEASE: true
47 changes: 47 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Code of Conduct

## Our Pledge

We, as contributors and maintainers of the Facebook-QuietFeed project, pledge to foster an open and welcoming environment for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct that could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [alnoman.dhoni@gmail.com](mailto:alnoman.dhoni@gmail.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

For answers to common questions about this code of conduct, see [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq).

---
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing to Facebook-QuietFeed

Thank you for considering contributing to Facebook-QuietFeed! We welcome your contributions to help us improve the extension and make it even better for our users.

## Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. Please see [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for details.

## How Can I Contribute?

### Reporting Bugs

- **Ensure the bug was not already reported:** Search the GitHub issues to see if someone else has already reported the same bug.
- **Open a new issue:** If you can't find an existing issue, please open a new issue with a clear and descriptive title. Provide as much detail as possible, including steps to reproduce the issue.

### Suggesting Enhancements

- **Open a new issue:** Share your ideas for enhancements with a clear and descriptive title. Explain how the enhancement would be valuable to users.

### Pull Requests

- Fork the repository and create your branch from `main`.
- If you've added code that should be tested, add tests.
- Ensure the test suite passes by running `npm test`.
- Make sure your code lints by running `npm run lint`.
- Issue that pull request!

### Development Setup

1. Clone the repository: `git clone https://github.com/your-username/Facebook-QuietFeed.git`
2. Navigate to the project folder: `cd Facebook-QuietFeed`


21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Facebook QuietFeed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 59 additions & 3 deletions css/popup.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,72 @@
body {
width: 200px;
height: 200px;
padding: 20px;
margin: 0;
padding:0;
width: 500px;
height: 540px;
text-align: center;
}

.popup-container {
display: flex;
flex-direction: column;
align-items: center;
padding:0 20px;
}
.top-bar {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
margin-bottom: 20px;
background: linear-gradient(to right, #f3f4f6, #f9fafb);
box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.1);
padding: 20px;
font-size:13px;
}

.left-content {
display: flex;
align-items: center;
}

.logo {
width: 48px;
height: 48px;
margin-right: 10px;
}

.middle-content {
flex: 1;
font-size: 18px;
}

.right-content {
font-size: 14px;
}

.github-link {
text-decoration: none;
color: #0077b5;
cursor: pointer;
}

.github-link:hover {
text-decoration: underline;
}

.log-issue-button {
background-color: #007bff;
color: white;
border: none;
padding: 10px 20px;
text-decoration: none;
cursor: pointer;
}

.log-issue-button:hover {
background-color: #0056b3


.logo {
width: 48px;
height: 48px;
Expand Down
64 changes: 33 additions & 31 deletions js/content.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
let lastScrollPosition = 0;
if (window.location.href === "https://www.facebook.com/") {
let lastScrollPosition = 0;

window.addEventListener("scroll", function () {
let currentScrollPosition = window.scrollY;
window.addEventListener("scroll", function () {
let currentScrollPosition = window.scrollY;

// Check if the user is scrolling down (scrolling away from the top)
if (currentScrollPosition > lastScrollPosition) {
// Check if the user scrolled at least 100px and is scrolling down
if (Math.abs(currentScrollPosition - lastScrollPosition) >= 300) {
hideSuggestedPosts();
// Check if the user is scrolling down (scrolling away from the top)
if (currentScrollPosition > lastScrollPosition) {
// Check if the user scrolled at least 100px and is scrolling down
if (Math.abs(currentScrollPosition - lastScrollPosition) >= 150) {
hideSuggestedPosts();
}
}
}
lastScrollPosition = currentScrollPosition;
});
lastScrollPosition = currentScrollPosition;
});

function hideSuggestedPosts() {
console.log("Runed");
let allElements = document.querySelectorAll(
'span.x193iq5w.xeuugli.x13faqbe.x1vvkbs.x1xmvt09.x1lliihq.x1s928wv.xhkezso.x1gmr53x.x1cpjm7i.x1fgarty.x1943h6x.xudqn12.x3x7a5m.x6prxxf.xvq8zen.xo1l8bm.xi81zsa[dir="auto"]'
);
let suggestedElements = [];
function hideSuggestedPosts() {
console.log("Runed");
let allElements = document.querySelectorAll(
'span.x193iq5w.xeuugli.x13faqbe.x1vvkbs.x1xmvt09.x1lliihq.x1s928wv.xhkezso.x1gmr53x.x1cpjm7i.x1fgarty.x1943h6x.xudqn12.x3x7a5m.x6prxxf.xvq8zen.xo1l8bm.xi81zsa[dir="auto"]'
);
let suggestedElements = [];

for (let i = 0; i < allElements.length; i++) {
let element = allElements[i];
if (element.textContent === "Suggested for you") {
suggestedElements.push(element);
for (let i = 0; i < allElements.length; i++) {
let element = allElements[i];
if (element.textContent === "Suggested for you") {
suggestedElements.push(element);
}
}
}

suggestedElements.forEach(function (spanElement) {
let parentElement = spanElement.parentElement;
while (parentElement) {
if (parentElement.classList.contains("x1lliihq")) {
parentElement.remove();
break;
suggestedElements.forEach(function (spanElement) {
let parentElement = spanElement.parentElement;
while (parentElement) {
if (parentElement.classList.contains("x1lliihq")) {
parentElement.remove();
break;
}
parentElement = parentElement.parentElement;
}
parentElement = parentElement.parentElement;
}
});
});
}
}
14 changes: 14 additions & 0 deletions js/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Fetch the version number from the GitHub API
fetch("https://api.github.com/repos/nomandhoni-cs/Facebook-QuietFeed/tags")
.then((response) => response.json())
.then((tags) => {
if (tags && tags.length > 0) {
const versionNumber = tags[0].name;
document.getElementById(
"version"
).textContent = `Version: ${versionNumber}`;
}
})
.catch((error) => {
console.error("Error fetching version:", error);
});
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Facebook QuietFeed",
"version": "0.2.0",
"version": "0.3.0",
"description": "Facebook QuietFeed: Silence the noise and distractions on your Facebook feed for a more focused browsing experience.",
"permissions": [
"activeTab",
Expand Down
19 changes: 16 additions & 3 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,23 @@

<body>
<div class="popup-container">
<img src="assets/logo/icon128.png" alt="Facebook QuietFeed Extension Logo" class="logo">
<h1 class="extension-name">Facebook QuietFeed</h1>
<a href="https://github.com/nomandhoni-cs/Facebook-QuietFeed" target="_blank" class="github-link">GitHub Repository</a>
<div class="top-bar">
<div class="version-number" id="version">Version: Fetching...</div>
<div class="middle-text">Something not working?</div>
<div class="button-container">
<a class="log-issue-button" target="_blank"
href="https://github.com/nomandhoni-cs/Facebook-QuietFeed/issues">Log an issue →</a>
</div>
</div>
<div>
<img src="assets/logo/icon128.png" alt="Facebook QuietFeed Extension Logo" class="logo">
<h1 class="extension-name">Facebook QuietFeed</h1>
<a href="https://github.com/nomandhoni-cs/Facebook-QuietFeed" target="_blank" class="github-link">GitHub
Repository</a>
</div>
</div>

<script src="js/popup.js"></script>
</body>

</html>

0 comments on commit e46181b

Please sign in to comment.