Skip to content

Commit

Permalink
Merge pull request #70 from penge/wildcards
Browse files Browse the repository at this point in the history
Add support for wildcards
  • Loading branch information
penge authored Dec 17, 2023
2 parents e337c35 + 8f3ace1 commit 3d0afd1
Show file tree
Hide file tree
Showing 22 changed files with 1,434 additions and 884 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
dist/
jest.config.js
33 changes: 33 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/** @type {import("eslint").Linter.Config} */
const config = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: [
"@typescript-eslint",
"@stylistic/ts",
],
rules: {
indent: ["error", 2],
quotes: ["error", "double", { avoidEscape: true }],
"quote-props": ["error", "as-needed"],
semi: ["error", "always"],
"no-multi-spaces": ["error", { ignoreEOLComments: true }],
"arrow-parens": ["error", "always"],
"@stylistic/ts/comma-dangle": ["error", "always-multiline"],
},
};

module.exports = config;
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

48 changes: 37 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Block Site

**Block Site** (formerly known as _Stop Social Media_) is a simple **Chrome/Firefox extension** that improves your productivity by blocking access to distracting websites as you specify.
**Block Site** is a simple **Chrome/Firefox extension** that improves your productivity by blocking access to distracting websites as you specify.

## Icon

Expand All @@ -11,21 +11,47 @@

## Usage

Click on the icon. Enter sites you would like to block, prepend `!` to exclude site from blocking, example:
Click on the icon. Enter sites to block. See [Examples](#examples).

Choose how to resolve blocked: **Close Tab**, or **Show Blocked info page**.

**Blocked info page** shows what _url_ was blocked, based on which _rule_ it was blocked, and optionally a blocked count over a chosen period of time:
_All Time_, _This Month_, _This Week_, or _Today_.

### Examples

Block `example.com` **only** (`example.com/apple/` and `orange.example.com` should work):
```
facebook.com
instagram.com
youtube.com
!music.youtube.com
reddit.com
!reddit.com/r/MachineLearning
example.com # or example.com/
```

Choose how to resolve blocked site: **Close Tab**, or **Show Blocked info page**.
<br>

**Blocked info page** shows what _url_ was blocked, based on which _rule_ it was blocked, and optionally a blocked count over a chosen period of time:
_All Time_, _This Month_, _This Week_, or _Today_.
Block any page on `example.com` (including `example.com`):
```
example.com/*
```

<br>

Block any subdomain of `example.com` **only** (`example.com` should work):
```
*.example.com
```

<br>

Block any page on `example.com` where first directory starts with any 4 characters (should block `example.com/pear/` or `example.com/plum/`, but not `example.com/orange/`):
```
example.com/????/*
```

<br>

Block any page on `example.com` where first directory starts with any characters but ends with `rry` (should block `example.com/cherry/` or `example.com/strawberry/`, but not `example.com/kiwi/`):
```
example.com/*rry/
```

## Privacy notice

Expand Down
4 changes: 3 additions & 1 deletion jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @type {import("ts-jest").JestConfigWithTsJest} */
module.exports = {
const config = {
preset: "ts-jest",
testEnvironment: "node",
};

module.exports = config;
Loading

0 comments on commit 3d0afd1

Please sign in to comment.