Giter Site home page Giter Site logo

penge / block-site Goto Github PK

View Code? Open in Web Editor NEW
243.0 8.0 30.0 398 KB

Chrome/Firefox extension that blocks access to distracting websites to improve your productivity.

Home Page: https://chrome.google.com/webstore/detail/block-site/bjcnpgekponkjpincbcoflgkdomldlnl

License: MIT License

JavaScript 2.22% HTML 6.69% CSS 8.23% TypeScript 82.86%
extension chrome-extension productivity block firefox-extension site

block-site's Issues

Feature request: Support Subdomains

Hello, this extension is working great, thanks for that, and I was thinking it can be improved even more.

Currently we can only block full URL and domains in general, but option to block (include) subdomains is not available.

Scenario: Let's say I want to block all URLs from one domain, and all subdomains that come from it.
Example URL: "https://onepunchman.fandom.com"
I can only block "fandom.com", and it works fine on that specific site, but it doesn't block any subpages.

  1. It could be improved by implementing wildcards support, like this:
    *.fandom.com
  2. Or when we add "fandom.com", it automatically includes subdomains as well

But i'd prefer option 1, because it gives us the control to choose.

Minimal UI/UX updates

Block-Site

  1. New label for on/off switch and move to the top for visibility
  2. Simplier block list (BL) description
  3. BL Entries as text value to ease updating
  4. Add tiktok to BL

Great extention guys. Here I propose some improvements.

Optional context menu

It would be beneficial to include a setting on the settings page where users can choose to display or hide the context menu option. This would effectively cater to both sides, ensuring a streamlined context menu without unnecessary clutter.

Originally posted by @Zeeex in #33 (comment)

Counter not visible in incognito mode.

Just wanted to inform that the new counter feature does not currently work in incognito mode. This is probably expected but in that case maybe it should default to closing the page or showing some default 'blocked page' sign. Currently it shows the following:
Screenshot 2023-01-01 at 9 15 38 PM

Fix path shown in Blocked info page

At the moment, Blocked info page shows it blocked a specific URL, like:

https://www.youtube.com/watch?v=some_video was blocked 32x.

which is not true. It wasn't https://www.youtube.com/watch?v=some_video that was blocked 32x, but the defined rule (in Options) that led to blocking, like youtube.com.

The correct message should then be:

youtube.com was blocked 32x.

This bug is now fixed and will be released as part of version 3.1.

An option to temporarily disable the blocking

To disable the bloking temporarily, you need to visit Extensions in the Google Chrome Settings, and disable the plugin.

Upcoming

I am currently working on adding a "Checkbox" to Options, that will easily toggle blocking on and off.

includes function is too broad for URL matching

Some URLs may include the addresses of blocked sites, despite being separate sites. For example, I was accessing a YouTube video via an RSS reader, and the tab was closed. Arguably this is intended behaviour, but I think it's too strict.

Instead, maybe match window.location.host to the restricted sites, instead of using includes?

Better block page

Page-blocked
Example image of ublock's block page.

Today i opened the browser, and didn't realized that youtube was a default blocked site. Now several youtube tabs are block pages, and I don't see a way to be them back, even after unblocking youtube, since the blocked URL isn't shown. I think i'd be nice to:

  1. Provide a way to retrive the blocked url
  2. Add dark mode as default for block pages, since encontering a blocked site at night and displaying a white page is very annoying.

Make textarea wider, don't wrap long lines

Textarea, where you write the rules, now supports URLs (see #13) and those can get long.

Suggestion:
Make textarea wider, and don't wrap the long lines (as they might then look as 2 or more rules, instead of 1).

Blocking home page only

Thanks for this extension!

This may be a feature request or a just a question, not sure.

I'd like to block a home page but allow everything else or, at least, specific paths. I tried the following but it didn't work:

youtube.com
!youtube.com/watch
!youtube.com/results

Is that currently possible?

EDIT: I was mistaken, it appears to work just fine. I think I assumed that rules are saved on textarea blur but they seem to be saved on window close. Either way, apologies for the noise and thanks again for sharing your work!

Why has Block Site stopped working?

I am using windows 10 and Chrome browser.
I was using the Block site extension happily until the blocked site list was recently greyed out an I cannot now enter a new www.**** to it.
Please advise.
Thank you

Tab closing automatically

Hello, I'm trying your nice extension. It's fine when opening a new tab but when I'm typing an url in an existing tab the tab closes with its history. It's an annoying behaviour. It would be great to set a landing page instead or just leave the current tab as it is, if it's not too complex to achieve.

Kind regards and happy Easter,
V.

Error: Could not load manifest on trying to load extension locally

I cloned the repo and tried to load the extension locally in the Chrome Browser by doing: More Tools -> Extensions -> Load Unpacked. But on choosing the folder, I am getting the following error:

Error
Could not load options page 'options.html'.
Could not load manifest.

Opening in new tab blocks the current site

Thank you for this plugin!

One small issue I noticed today:

Suppose that y.com is on my blocked sites' list and I selected to show blocked page info when the site is blocked. If I'm browsing on x.com and decide to open y.com in a new tab through a hyperlink on x.com (or even a bookmark in my bookmarks's bar), y.com will open just fine and it is the current tab (x.com in this case) that will show blocked page info.

Add option to pick Count period

Agreed to add option to pick period for counter: All time, This month, This week, Today

Note: Previous discussion started on how to reset the count (counter) but that won't be necessary.


Should counter persist between browsing sessions?

Especially considering there is no way to reset the counter.

๐Ÿค”

Add toggle option directly to dropdown options

Currently clicking on the extension icon shows links to store page, manage/remove extensions, options and unpin.
Situation
It takes too many steps to quickly enable or disable block sites from the list of sites that were defined in the extension.
Presently, you'd have to click on the extension, go to options, check/uncheck the Enabled? checkbox, and hit Save. That's one step too many.
Proposal
Add enable/disable toggle to the dropdown context menu
image

Can i use it in my project

Hello Penge,
As i am programing a Chrome extension , i want to add custom site blocking option in options page so please allow me to use options.html, background.js, options.js files in my project
Am planning to use It with credits (Thank You To Penge For This Blocksite)
I Just walk through the license file and came to know that Permission is hereby granted, free of charge and the Software without restriction. including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software for this repo

Please Permit Me To Do This

Thank You Penge

Feature request - block subdirectories only

Appreciate the work you've done. Really like how simple and easy it is.
Any way to block specific subdomains but still allow top domain? i.e. block youtube.com/user/BBC but still allow youtube.com

Password Protect

Sorry to bother you in this manner, but I was wondering, this would make a great tool for parents to block unwanted sites so that kids can not access certain sites, making it safe for children to use the internet.
THIS IS AN EXCELLENT EXTENSION, AND IT IS VERY SIMPLE TO USE. I LOVE IT!
Suggestion:

  1. Add a Password protect to remove or modify any sites. No password required to ADD a site
  2. Add a password to modify settings, such as duration of blocked site.
  3. Add a password to remove the extension from either chrome or fire fox once it has been installed.
    Sincerely,
    OldGrayWolf

click to block

instead of not allowing the site, how can we blacklist the list of websites where the chrome extension doesn't work manually on user preference?

Timed blockage

|t would be great if we could schedule how long a page is blocked.
For instance, some users want to block email during the morning, and some users might want to have access to certain websites only during certain hours of the day.

Can we add a redirect function?

Can we add a redirect function so when you try to enter a blocked site it redirects you to a judging picture of terry crews or something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.