A browser extension that helps users stay focused with website restriction features and a timer that supports time-based focus and break intervals.
Please visit the Zero In website for more details and installation.
- Node.js: I use v20 and if you use nvm, you can run
nvm useto switch to that version. - Yarn: Follow the instructions here for how to enabling Yarn if you haven't.
yarn- Run
yarn formatto apply Prettier (see.prettierrc.jsonfor options) andyarn format-checkbefore pushing. - A pre-commit hook runs
lint-stagedto format staged files; it is installed viasimple-git-hooksonyarn install. If you need to reinstall the hooks, runyarn simple-git-hooks.
yarn devyarn buildRun Unit Tests with Vitest
yarn test:unitRun End-to-End Tests with Playwright
# Install browsers for the first run
npx playwright install
# When testing on CI, must build the project first
yarn build:ci
# Runs the end-to-end tests
yarn test:e2eLint with ESLint
yarn lintIf you want to copy data from one extension to another, you can use the following steps:
- In the Target Extension Console
chrome.runtime.onMessageExternal.addListener(function (request, sender, sendResponse) {
if (request.action === 'import_storage' && request.data) {
chrome.storage.local.set(request.data, function () {
sendResponse({ success: true })
})
return true
}
})- In the Source Extension Console
chrome.storage.local.get(null, function (data) {
chrome.runtime.sendMessage(
TARGET_EXTENSION_ID,
{
action: 'import_storage',
data: data
},
function (response) {
console.log('Data transfer response:', response)
}
)
})For the TARGET_EXTENSION_ID, you can find it in the URL of page in that extension, which looks like chrome-extension://<extension-id>/. OR you can find it in the chrome://extensions/.
license-checker --production --markdown --out THIRD_PARTY_LICENSES_LIBRARIES.md
And remove the last line of zero in itself.