-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
13,892 additions
and
5,678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"webextensions": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"rules": { | ||
"indent": ["error", 4, { "SwitchCase": 1 }], | ||
"quotes": ["error", "double"], | ||
"semi": ["error", "always"], | ||
"curly": ["error", "all"], | ||
"eqeqeq": ["error", "always"], | ||
"padding-line-between-statements": [ | ||
"error", | ||
{ | ||
"blankLine": "always", | ||
"prev": "*", | ||
"next": "function" | ||
} | ||
], | ||
"no-trailing-spaces": "error", | ||
"comma-spacing": "error", | ||
"no-nested-ternary": "error", | ||
"max-depth": ["error", 4] | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
} | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"indent": ["error", 4, { "SwitchCase": 1 }], | ||
"quotes": ["warn", "double"], | ||
"semi": ["warn", "always"], | ||
"eqeqeq": ["error", "always"], | ||
"no-trailing-spaces": "warn", | ||
"comma-spacing": "warn", | ||
"no-nested-ternary": "warn", | ||
"max-depth": ["warn", 4] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
* text=auto | ||
|
||
*.ts text eol=lf | ||
*.js text eol=lf | ||
*.json text eol=lf | ||
*.html text eol=lf | ||
*.css text eol=lf | ||
|
||
*.png binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
*.swp | ||
node_modules | ||
node_modules/ | ||
dist/ | ||
.cache/ | ||
web-ext-artifacts/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Building History Cleaner 1.3.0 | ||
|
||
## System Info | ||
* Ubuntu 20.10 | ||
* node v14.15.3 | ||
* npm 6.14.9 | ||
* bash 5.0.17 | ||
* For tool and library versions, check package.json | ||
|
||
# Building | ||
|
||
To build the extension, run: | ||
```shell | ||
# Install node modules | ||
npm install | ||
|
||
# Build the extension | ||
# Moves / bundles assets to dist | ||
npm run build:prod | ||
|
||
# Zip extension for distribution | ||
npm run build:extension | ||
``` | ||
The built files will be in `./dist` and the complete extension will be `./web-ext-artifacts/history_cleaner-1.3.0.zip` | ||
|
||
# Testing the extension | ||
|
||
To test the extension, run: | ||
```shell | ||
npm run build:dev | ||
``` | ||
This will build the extension to `./dist` and rebuild it on file changes. `./dist` can be loaded as a temporary extension in Chrome or Firefox. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
v1.3.0 Changelog | ||
* Rewrote extension in TypeScript | ||
* Option to change idle length | ||
* Option to show notifications when history is deleted | ||
* Option to delete history on startup instead of idle | ||
* Button to manually delete history on options page | ||
* Basic sync support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
# HistoryCleaner | ||
Firefox addon that deletes history older than a specified amount of days. | ||
|
||
This addon is inspired by and is a WebExtension port of [Expire History By Days](https://addons.mozilla.org/en-US/firefox/addon/expire-history-by-days/). | ||
Delete your browsing history older than a specified number of days (to do this go into the Firefox Add-ons Manager, find History Cleaner, and set the number of days in Preferences; setting it to “0” will disable history deletion). | ||
|
||
Set the number of days to keep history items in the options page. Setting it to 0 will disable history deletion. The deletion will occur when the browser goes idle (after about 1 minute of inactivity). | ||
The History Cleaner icon is from [Material Design Icons](https://materialdesignicons.com/) | ||
|
||
The icon is from [Material Design Icons](https://materialdesignicons.com/) | ||
|
||
[Link to addon page](https://addons.mozilla.org/en-US/firefox/addon/history-cleaner/) | ||
[AMO](https://addons.mozilla.org/en-US/firefox/addon/history-cleaner/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"use strict"; | ||
const cpx = require("cpx"); | ||
|
||
const src = "src/**/*.{json,png}"; | ||
const dest = "dist"; | ||
|
||
/** | ||
* Copys assets to destination folder | ||
* @param {boolean} production | ||
*/ | ||
module.exports = function assets(production) { | ||
if (production) { | ||
cpx.copySync(src, dest); | ||
} else { | ||
const watch = cpx.watch(src, dest); | ||
watch.on("copy", (e) => console.log(e.srcPath, "copied to", e.dstPath)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"use strict"; | ||
const clean = require("./clean"); | ||
const bundle = require("./bundle"); | ||
const assets = require("./assets"); | ||
|
||
async function main() { | ||
process.env.NODE_ENV = process.argv[2]; | ||
const prod = process.argv[2] === "production"; | ||
|
||
console.log("Cleaning..."); | ||
await clean(); | ||
console.log("Copying assets..."); | ||
assets(prod); | ||
console.log("Building bundle..."); | ||
await bundle(prod); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use strict"; | ||
const Bundler = require("parcel-bundler"); | ||
|
||
const entryFiles = ["src/**/*.html", "src/background.ts"]; | ||
|
||
const options = { | ||
watch: true, | ||
target: "browser", | ||
hmr: false, | ||
detailedReport: false, | ||
autoInstall: false | ||
}; | ||
|
||
/** | ||
* Bundles assets | ||
* @param {boolean} production | ||
*/ | ||
module.exports = async function bundle(production) { | ||
if (production) { | ||
options.watch = false; | ||
options.detailedReport = true; | ||
} | ||
|
||
const bundler = new Bundler(entryFiles, options); | ||
|
||
await bundler.bundle(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use strict"; | ||
const mkdir = require("make-dir"); | ||
const del = require("del"); | ||
|
||
module.exports = async function clean() { | ||
await mkdir("dist"); | ||
await del("dist/*"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.