forked from ansh/jiffyreader.com
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from asieduernest12/feat/dynamicHtmlNodesExclu…
…sions Feat/dynamic html nodes exclusions
- Loading branch information
Showing
21 changed files
with
240 additions
and
109 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 |
---|---|---|
|
@@ -5,28 +5,28 @@ | |
"description": "jiffy reader", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"dev": "PLASMO_VERSION=\"$(npm pkg get version | tr -d '\"')\" PLASMO_TARGET=${PLASMO_TARGET:-chrome} PLASMO_NAME=${PLASMO_NAME:-\"jiffy-reader-chrome\"} PLASMO_TAG=${PLASMO_TAG:-dev} PLASMO_VERSION_NAME=$PLASMO_VERSION-$PLASMO_TARGET-$PLASMO_TAG PLASMO_DEBUG=${PLASMO_DEBUG:-TRUE} PLASMO_SHORTCUT=${PLASMO_SHORTCUT:-\"Alt+B\"} plasmo dev --target=${PLASMO_MANIFEST_VERSION:-chrome-mv3}", | ||
"buildx": "PLASMO_VERSION=\"$(npm pkg get version | tr -d '\"')\" PLASMO_TARGET=${PLASMO_TARGET:-chrome} PLASMO_NAME=${PLASMO_NAME:-\"Jiffy Reader\"} PLASMO_TAG=${PLASMO_TAG:-prod} PLASMO_VERSION_NAME=$PLASMO_VERSION-$PLASMO_TARGET-$PLASMO_TAG PLASMO_DEBUG=${PLASMO_DEBUG:-FALSE} PLASMO_SHORTCUT=${PLASMO_SHORTCUT:-\"Alt+B\"} plasmo build --target=${PLASMO_MANIFEST_VERSION:-chrome-mv3}", | ||
"dev": "PLASMO_PUBLIC_VERSION=\"$(npm pkg get version | tr -d '\"')\" PLASMO_PUBLIC_TARGET=${PLASMO_PUBLIC_TARGET:-chrome} PLASMO_PUBLIC_NAME=${PLASMO_PUBLIC_NAME:-\"jiffy-reader-chrome\"} PLASMO_PUBLIC_TAG=${PLASMO_PUBLIC_TAG:-dev} PLASMO_TAG=$PLASMO_PUBLIC_TAG PLASMO_PUBLIC_VERSION_NAME=$PLASMO_PUBLIC_VERSION-$PLASMO_PUBLIC_TARGET-$PLASMO_PUBLIC_TAG PLASMO_PUBLIC_DEBUG=${PLASMO_PUBLIC_DEBUG:-TRUE} PLASMO_PUBLIC_SHORTCUT=${PLASMO_PUBLIC_SHORTCUT:-\"Alt+B\"} plasmo dev --target=${PLASMO_PUBLIC_MANIFEST_VERSION:-chrome-mv3}", | ||
"buildx": "PLASMO_PUBLIC_VERSION=\"$(npm pkg get version | tr -d '\"')\" PLASMO_PUBLIC_TARGET=${PLASMO_PUBLIC_TARGET:-chrome} PLASMO_PUBLIC_NAME=${PLASMO_PUBLIC_NAME:-\"Jiffy Reader\"} PLASMO_PUBLIC_TAG=${PLASMO_PUBLIC_TAG:-prod} PLASMO_TAG=$PLASMO_PUBLIC_TAG PLASMO_PUBLIC_VERSION_NAME=$PLASMO_PUBLIC_VERSION-$PLASMO_PUBLIC_TARGET-$PLASMO_PUBLIC_TAG PLASMO_PUBLIC_DEBUG=${PLASMO_PUBLIC_DEBUG:-FALSE} PLASMO_PUBLIC_SHORTCUT=${PLASMO_PUBLIC_SHORTCUT:-\"Alt+B\"} plasmo build --target=${PLASMO_PUBLIC_MANIFEST_VERSION:-chrome-mv3}", | ||
"build": "npm run build:opera && npm run build:chrome & npm run build:firefox & npm run build:safari", | ||
"dev:chrome": "npm run dev", | ||
"dev:firefox": "PLASMO_NAME=jiffy-reader-firefox PLASMO_TARGET=firefox PLASMO_SHORTCUT=\"Alt+W\" PLASMO_MANIFEST_VERSION=firefox-mv2 npm run dev", | ||
"dev:safari": "PLASMO_NAME=jiffy-reader-safari PLASMO_TARGET=safari PLASMO_SHORTCUT=\"Alt+W\" PLASMO_MANIFEST_VERSION=safari-mv2 npm run dev", | ||
"dev:firefox": "PLASMO_PUBLIC_NAME=jiffy-reader-firefox PLASMO_PUBLIC_TARGET=firefox PLASMO_PUBLIC_SHORTCUT=\"Alt+W\" PLASMO_PUBLIC_MANIFEST_VERSION=firefox-mv2 npm run dev", | ||
"dev:safari": "PLASMO_PUBLIC_NAME=jiffy-reader-safari PLASMO_PUBLIC_TARGET=safari PLASMO_PUBLIC_SHORTCUT=\"Alt+W\" PLASMO_PUBLIC_MANIFEST_VERSION=safari-mv2 npm run dev", | ||
"build:chrome": "npm run buildx && npm run bundle:chrome", | ||
"build:opera": "PLASMO_TARGET=opera PLASMO_MANIFEST_VERSION=opera-mv3 npm run build:chrome && npm run bundle:opera", | ||
"build:firefox": "PLASMO_NAME=jiffy-reader-firefox PLASMO_TARGET=firefox PLASMO_SHORTCUT=\"Alt+W\" PLASMO_MANIFEST_VERSION=firefox-mv2 npm run buildx && npm run bundle:firefox", | ||
"build:safari": "PLASMO_NAME=jiffy-reader-safari PLASMO_TARGET=safari PLASMO_SHORTCUT=\"Alt+W\" PLASMO_MANIFEST_VERSION=safari-mv2 npm run buildx && npm run bundle:safari", | ||
"gh:build:chrome": "PLASMO_TARGET=chrome PLASMO_SHORTCUT=\"Alt+B\" npm run buildx && npm run bundle:chrome", | ||
"gh:build:opera": "PLASMO_TARGET=opera PLASMO_SHORTCUT=\"Alt+B\" PLASMO_MANIFEST_VERSION=opera-mv3 npm run buildx && npm run bundle:opera", | ||
"gh:build:firefox": "PLASMO_TARGET=firefox PLASMO_SHORTCUT=\"Alt+W\" PLASMO_MANIFEST_VERSION=firefox-mv2 npm run buildx && npm run bundle:firefox", | ||
"gh:build:safari": "PLASMO_TARGET=safari PLASMO_SHORTCUT=\"Alt+W\" PLASMO_MANIFEST_VERSION=safari-mv2 npm run buildx && npm run bundle:safari", | ||
"gh:build": "echo 'PLASMO_TAG=prod NODE_ENV=production npm run gh:build:' | xargs -I{} bash -c '{}opera && {}chrome & {}firefox & {}safari & wait'", | ||
"gh:build:development": "echo 'PLASMO_TAG=dev NODE_ENV=development PLASMO_NAME=Jiffy-Reader-Dev npm run gh:build:' | xargs -I{} bash -c '{}opera && {}chrome & {}firefox & {}safari & wait'", | ||
"gh:build:bookmarklet": "PLASMO_VERSION=\"$(npm pkg get version | tr -d '\"')\" node src/Bookmarklet/esbuild.mjs", | ||
"build:opera": "PLASMO_PUBLIC_TARGET=opera PLASMO_PUBLIC_MANIFEST_VERSION=opera-mv3 npm run build:chrome && npm run bundle:opera", | ||
"build:firefox": "PLASMO_PUBLIC_NAME=jiffy-reader-firefox PLASMO_PUBLIC_TARGET=firefox PLASMO_PUBLIC_SHORTCUT=\"Alt+W\" PLASMO_PUBLIC_MANIFEST_VERSION=firefox-mv2 npm run buildx && npm run bundle:firefox", | ||
"build:safari": "PLASMO_PUBLIC_NAME=jiffy-reader-safari PLASMO_PUBLIC_TARGET=safari PLASMO_PUBLIC_SHORTCUT=\"Alt+W\" PLASMO_PUBLIC_MANIFEST_VERSION=safari-mv2 npm run buildx && npm run bundle:safari", | ||
"gh:build:chrome": "PLASMO_PUBLIC_TARGET=chrome PLASMO_PUBLIC_SHORTCUT=\"Alt+B\" npm run buildx && npm run bundle:chrome", | ||
"gh:build:opera": "PLASMO_PUBLIC_TARGET=opera PLASMO_PUBLIC_SHORTCUT=\"Alt+B\" PLASMO_PUBLIC_MANIFEST_VERSION=opera-mv3 npm run buildx && npm run bundle:opera", | ||
"gh:build:firefox": "PLASMO_PUBLIC_TARGET=firefox PLASMO_PUBLIC_SHORTCUT=\"Alt+W\" PLASMO_PUBLIC_MANIFEST_VERSION=firefox-mv2 npm run buildx && npm run bundle:firefox", | ||
"gh:build:safari": "PLASMO_PUBLIC_TARGET=safari PLASMO_PUBLIC_SHORTCUT=\"Alt+W\" PLASMO_PUBLIC_MANIFEST_VERSION=safari-mv2 npm run buildx && npm run bundle:safari", | ||
"gh:build": "echo 'PLASMO_PUBLIC_TAG=prod NODE_ENV=production npm run gh:build:' | xargs -I{} bash -c '{}opera && {}chrome & {}firefox & {}safari && wait'", | ||
"gh:build:development": "echo 'PLASMO_PUBLIC_TAG=dev NODE_ENV=development PLASMO_PUBLIC_NAME=Jiffy-Reader-Dev npm run gh:build:' | xargs -I{} bash -c '{}opera && {}chrome & {}firefox & {}safari && wait'", | ||
"gh:build:bookmarklet": "PLASMO_PUBLIC_VERSION=\"$(npm pkg get version | tr -d '\"')\" node src/Bookmarklet/esbuild.mjs", | ||
"bundle": "npm run bundle:chrome & npm run bundle:firefix & npm run bundle:safari", | ||
"bundle:firefox": "cd build/firefox-mv2-$PLASMO_TAG/ && zip -r ../jiffyReader-firefox-$PLASMO_TAG.xpi ./*", | ||
"bundle:safari": "cd build/safari-mv2-$PLASMO_TAG/ && zip -r ../jiffyReader-safari-$PLASMO_TAG.xpi ./*", | ||
"bundle:chrome": "cd build/chrome-mv3-$PLASMO_TAG && zip -r ../jiffyReader-chrome-$PLASMO_TAG.zip ./*", | ||
"bundle:opera": "cd build/opera-mv3-$PLASMO_TAG && zip -r ../jiffyReader-opera-$PLASMO_TAG.crx ./*", | ||
"bundle:firefox": "cd build/firefox-mv2-$PLASMO_PUBLIC_TAG/ && zip -r ../jiffyReader-firefox-$PLASMO_PUBLIC_TAG.xpi ./*", | ||
"bundle:safari": "cd build/safari-mv2-$PLASMO_PUBLIC_TAG/ && zip -r ../jiffyReader-safari-$PLASMO_PUBLIC_TAG.xpi ./*", | ||
"bundle:chrome": "cd build/chrome-mv3-$PLASMO_PUBLIC_TAG && zip -r ../jiffyReader-chrome-$PLASMO_PUBLIC_TAG.zip ./*", | ||
"bundle:opera": "cd build/opera-mv3-$PLASMO_PUBLIC_TAG && zip -r ../jiffyReader-opera-$PLASMO_PUBLIC_TAG.crx ./*", | ||
"build:ios": "xcrun safari-web-extension-converter --rebuild-project \"Jiffy reader/Jiffy reader.xcodeproj\"", | ||
"build:xcode": "pnpm build:safari && xcrun safari-web-extension-converter --swift --no-open --force --bundle-identifier com.jiffyreader build/safari-mv2-prod", | ||
"build:xcode:all": "pnpm build:xcode && pnpm build:ios", | ||
|
@@ -74,11 +74,11 @@ | |
"typescript": "4.7.4" | ||
}, | ||
"manifest": { | ||
"name": "$PLASMO_NAME", | ||
"target": "$PLASMO_TARGET", | ||
"version": "$PLASMO_VERSION", | ||
"tag": "$PLASMO_TAG", | ||
"version_name": "$PLASMO_VERSION_NAME", | ||
"name": "$PLASMO_PUBLIC_NAME", | ||
"target": "$PLASMO_PUBLIC_TARGET", | ||
"version": "$PLASMO_PUBLIC_VERSION", | ||
"tag": "$PLASMO_PUBLIC_TAG", | ||
"version_name": "$PLASMO_PUBLIC_VERSION_NAME", | ||
"environment": "$NODE_ENV", | ||
"description": "A Browser Extension for Faster Reading on ANY website!", | ||
"default_locale": "en", | ||
|
@@ -93,7 +93,7 @@ | |
"commands": { | ||
"toggle-bionic": { | ||
"suggested_key": { | ||
"default": "$PLASMO_SHORTCUT" | ||
"default": "$PLASMO_PUBLIC_SHORTCUT" | ||
}, | ||
"description": "Toggle bionic reading mode" | ||
} | ||
|
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
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
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 @@ | ||
import defaultPrefs from '~services/preferences'; | ||
import usePrefs from '~services/usePrefs'; | ||
import { useGetTabOriginCb } from './useGetTabOriginCb'; | ||
|
||
export function HtmlNodeToggles() { | ||
const [prefs, , updateConfig] = usePrefs(useGetTabOriginCb(), false); | ||
const _label = chrome.i18n.getMessage('symanticElementsLabel'); | ||
|
||
if (!prefs) return <></>; | ||
|
||
return ( | ||
<div className=" flex flex-column || gap-2 || w-100 p-2"> | ||
<label className="block text-capitalize mb-sm" id="symanticElementsLabel"> | ||
{_label?.length ? _label : 'Enabled Items'} | ||
</label> | ||
|
||
<div className="|| || w-100 gap-1" style={{ display: 'grid', gridTemplateColumns: 'repeat(3,1fr)' }}> | ||
{Object.entries({ ...defaultPrefs.symanticTags, ...prefs.symanticTags }).map(([key, value]) => ( | ||
<div key={key} className="input-container flex"> | ||
<input | ||
type="checkbox" | ||
id={`symanticTags-${key}`} | ||
checked={value} | ||
onChange={(event) => updateConfig(`symanticTags`, { ...prefs.symanticTags, [key]: event.target.checked })} | ||
/> | ||
<label htmlFor={`symanticTags-${key}`}>{key ?? chrome.i18n.getMessage(`symanticTags_${key}`)}</label> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.