Skip to content

Commit

Permalink
Add Prettier Formatting for Markdown Files and Pre-Commit Hook (#543)
Browse files Browse the repository at this point in the history
* Install prettier, add prettierignore

* Add precommit hook for md

* Prettier format md files
  • Loading branch information
MarvNC authored Feb 3, 2024
1 parent e598a97 commit 97c5c74
Show file tree
Hide file tree
Showing 10 changed files with 1,332 additions and 289 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Everything
**/**.*

# Except for markdown
!**/*.md
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Yomitan <!-- omit from toc -->
# Yomitan <!-- omit from toc -->

[![Chrome Release](<https://img.shields.io/chrome-web-store/v/likgccmbimhjbgkjambclfkhldnlhbnn?logo=Google%20Chrome&logoColor=lightblue&color=lightblue&label=chrome%20release%20(stable)>)](https://chrome.google.com/webstore/detail/yomitan/likgccmbimhjbgkjambclfkhldnlhbnn)
[![Firefox Release](<https://img.shields.io/amo/v/yomitan?logo=Firefox&color=orange&label=firefox%20release%20(stable)>)](https://addons.mozilla.org/en-US/firefox/addon/yomitan/)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/themoeway/yomitan/badge)](https://securityscorecards.dev/viewer/?uri=github.com/themoeway/yomitan)
[![Discord](https://dcbadge.vercel.app/api/server/UGNPMDE7zC?style=flat)](https://discord.gg/UGNPMDE7zC)
[![Discord](https://dcbadge.vercel.app/api/server/UGNPMDE7zC?style=flat)](https://discord.gg/UGNPMDE7zC)

:wave: **This project is a community fork of Yomichan** (which was [sunset](https://foosoft.net/posts/sunsetting-the-yomichan-project/) by its owner on Feb 26 2023). We have made a number of foundational changes to ensure **the project stays alive, works on latest browser versions, and is easy to contribute to**:

Expand Down Expand Up @@ -57,6 +58,7 @@ Yomitan provides advanced features not available in other browser-based dictiona
Yomitan comes in two flavors: _stable_ and _testing_. New changes are initially introduced into the _testing_ version, and after some time spent ensuring that they are relatively bug free, they will be promoted to the _stable_ version. If you are technically savvy and don't mind submitting issues on GitHub, try the _testing_ version; otherwise, the _stable_ version will be your best bet.

- **Google Chrome**

- [stable](https://chrome.google.com/webstore/detail/yomitan/likgccmbimhjbgkjambclfkhldnlhbnn)
- [testing](https://chrome.google.com/webstore/detail/yomitan-development-build/glnaenfapkkecknnmginabpmgkenenml)

Expand Down
1 change: 1 addition & 0 deletions dev/lib/handlebars/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A custom version of the handlebars package which, to improve security, does not
## Limitations

- Only the following compile options are supported:

- `data`
- `knownHelpers`
- `knownHelpersOnly`
Expand Down
154 changes: 88 additions & 66 deletions docs/browser-bugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,111 +3,133 @@
This page lists several of the browser bugs that have affected Yomichan over the years.

## Audio doesn't work when autoplay=false
* **Browser**: Firefox
* **Date**: 2018-06-17
* **Issue**: [#129](https://github.com/FooSoft/yomichan/issues/129), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1466926)

- **Browser**: Firefox
- **Date**: 2018-06-17
- **Issue**: [#129](https://github.com/FooSoft/yomichan/issues/129), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1466926)

## Ruby text layouts don't always work correctly for certain fonts
* **Browser**: Chrome
* **Date**: 2019-08-11
* **Links**: [#178](https://github.com/FooSoft/yomichan/issues/178), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1045755), [Demo](https://github.com/toasted-nutbread/chrome-layout-bug)

- **Browser**: Chrome
- **Date**: 2019-08-11
- **Links**: [#178](https://github.com/FooSoft/yomichan/issues/178), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1045755), [Demo](https://github.com/toasted-nutbread/chrome-layout-bug)

## document.execCommand('paste') doesn't work correctly on web extension background page
* **Browser**: Firefox
* **Date**: 2019-12-14
* **Links**: [#307](https://github.com/FooSoft/yomichan/pull/307), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1603985), [Demo](https://github.com/toasted-nutbread/firefox-clipboard-paste-bug)

- **Browser**: Firefox
- **Date**: 2019-12-14
- **Links**: [#307](https://github.com/FooSoft/yomichan/pull/307), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1603985), [Demo](https://github.com/toasted-nutbread/firefox-clipboard-paste-bug)

## Touch events can have incorrect position
* **Browser**: Firefox
* **Date**: 2020-01-18
* **Links**: [#316](https://github.com/FooSoft/yomichan/pull/316), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1610145), [Demo](https://github.com/toasted-nutbread/firefox-touch-position-bug)

- **Browser**: Firefox
- **Date**: 2020-01-18
- **Links**: [#316](https://github.com/FooSoft/yomichan/pull/316), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1610145), [Demo](https://github.com/toasted-nutbread/firefox-touch-position-bug)

## Triple click doesn't select text properly
* **Browser**: Firefox
* **Date**: 2020-01-30
* **Issue**: [#340](https://github.com/FooSoft/yomichan/pull/340), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1612236), [Demo](https://github.com/toasted-nutbread/firefox-text-selection-bug)

- **Browser**: Firefox
- **Date**: 2020-01-30
- **Issue**: [#340](https://github.com/FooSoft/yomichan/pull/340), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1612236), [Demo](https://github.com/toasted-nutbread/firefox-text-selection-bug)

## unhandledrejection event doesn't work correctly in content scripts
* **Browser**: Firefox
* **Date**: 2020-04-12
* **Issue**: [#454](https://github.com/FooSoft/yomichan/pull/454), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1632270)

- **Browser**: Firefox
- **Date**: 2020-04-12
- **Issue**: [#454](https://github.com/FooSoft/yomichan/pull/454), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1632270)

## chrome.tabs.sendMessage doesn't work correctly
* **Browser**: Firefox (Nightly)
* **Date**: 2020-06-04
* **Links**: [#588](https://github.com/FooSoft/yomichan/issues/588), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1643649), [Demo](https://github.com/toasted-nutbread/firefox-web-extension-send-message-bug)

- **Browser**: Firefox (Nightly)
- **Date**: 2020-06-04
- **Links**: [#588](https://github.com/FooSoft/yomichan/issues/588), [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1643649), [Demo](https://github.com/toasted-nutbread/firefox-web-extension-send-message-bug)

## CSS animations don't work correctly when using an attribute on the root
* **Browser**: Chrome
* **Date**: 2020-06-05
* **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1087188), [Demo](https://github.com/toasted-nutbread/chrome-animated-text-color-bug)

- **Browser**: Chrome
- **Date**: 2020-06-05
- **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1087188), [Demo](https://github.com/toasted-nutbread/chrome-animated-text-color-bug)

## Pen pointer events have various issues
* **Browser**: Firefox
* **Date**: 2020-09-12
* **Links**: [#819](https://github.com/FooSoft/yomichan/pull/819), [#820](https://github.com/FooSoft/yomichan/pull/820), [#821](https://github.com/FooSoft/yomichan/pull/821), [#824](https://github.com/FooSoft/yomichan/pull/824), [Report 1](https://bugzilla.mozilla.org/show_bug.cgi?id=1449660), [Report 2](https://bugzilla.mozilla.org/show_bug.cgi?id=1487509), [Report 3](https://bugzilla.mozilla.org/show_bug.cgi?id=1583480), [Report 4](https://bugzilla.mozilla.org/show_bug.cgi?id=1583519), [Report 5](https://bugzilla.mozilla.org/show_bug.cgi?id=1631377)

- **Browser**: Firefox
- **Date**: 2020-09-12
- **Links**: [#819](https://github.com/FooSoft/yomichan/pull/819), [#820](https://github.com/FooSoft/yomichan/pull/820), [#821](https://github.com/FooSoft/yomichan/pull/821), [#824](https://github.com/FooSoft/yomichan/pull/824), [Report 1](https://bugzilla.mozilla.org/show_bug.cgi?id=1449660), [Report 2](https://bugzilla.mozilla.org/show_bug.cgi?id=1487509), [Report 3](https://bugzilla.mozilla.org/show_bug.cgi?id=1583480), [Report 4](https://bugzilla.mozilla.org/show_bug.cgi?id=1583519), [Report 5](https://bugzilla.mozilla.org/show_bug.cgi?id=1631377)

## Cannot read clipboard from service worker in a MV3 chrome extension
* **Browser**: Chrome
* **Date**: 2020-12-18
* **Links**: [#455](https://github.com/FooSoft/yomichan/issues/455), [#1247](https://github.com/FooSoft/yomichan/issues/1247), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1160302)

- **Browser**: Chrome
- **Date**: 2020-12-18
- **Links**: [#455](https://github.com/FooSoft/yomichan/issues/455), [#1247](https://github.com/FooSoft/yomichan/issues/1247), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1160302)

## Textareas display incorrectly when they have an animated CSS transform
* **Browser**: Chrome
* **Date**: 2021-01-30
* **Links**: [Demo](https://toasted-nutbread.github.io/chrome-textarea-transform-bug/), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1172666)

- **Browser**: Chrome
- **Date**: 2021-01-30
- **Links**: [Demo](https://toasted-nutbread.github.io/chrome-textarea-transform-bug/), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1172666)

## Chrome extensions using port connections can crash the browser using manifest version 3
* **Browser**: Chrome
* **Date**: 2021-02-13
* **Links**: [Demo](https://github.com/toasted-nutbread/chrome-extension-port-connect-crash), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1178179)

- **Browser**: Chrome
- **Date**: 2021-02-13
- **Links**: [Demo](https://github.com/toasted-nutbread/chrome-extension-port-connect-crash), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1178179)

## Chrome extension Port.onDisconnect event does not always fire in content scripts
* **Browser**: Chrome
* **Date**: 2021-02-13
* **Links**: [Demo](https://github.com/toasted-nutbread/chrome-extension-port-disconnect-bug), [Report 1](https://bugs.chromium.org/p/chromium/issues/detail?id=1178188) (MV2), [Report 2](https://bugs.chromium.org/p/chromium/issues/detail?id=1178189) (MV3)

- **Browser**: Chrome
- **Date**: 2021-02-13
- **Links**: [Demo](https://github.com/toasted-nutbread/chrome-extension-port-disconnect-bug), [Report 1](https://bugs.chromium.org/p/chromium/issues/detail?id=1178188) (MV2), [Report 2](https://bugs.chromium.org/p/chromium/issues/detail?id=1178189) (MV3)

## Ruby elements with padding have incorrect layout
* **Browser**: Firefox
* **Date**: 2021-03-05
* **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1696721)

- **Browser**: Firefox
- **Date**: 2021-03-05
- **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1696721)

## Focus changes don't preserve caret position for caret browsing
* **Browser**: Chrome
* **Date**: 2021-05-19
* **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1211175)

- **Browser**: Chrome
- **Date**: 2021-05-19
- **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1211175)

## CSS :active state on &lt;label&gt; element doesn't match state on inner element
* **Browser**: Chrome
* **Date**: 2021-05-19
* **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1211182)

- **Browser**: Chrome
- **Date**: 2021-05-19
- **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1211182)

## Caret browsing doesn't work properly for certain display:none elements
* **Browser**: Firefox
* **Date**: 2021-06-06
* **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1714883)

- **Browser**: Firefox
- **Date**: 2021-06-06
- **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1714883)

## IndexedDB writes from a Worker thread do not persist if worker is terminated
* **Browser**: ~~Chrome~~, Firefox _(warning only)_
* **Date**: 2021-08-07
* **Links**: ~~[Chrome Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1237686)~~, [Firefox Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1724602)

- **Browser**: ~~Chrome~~, Firefox _(warning only)_
- **Date**: 2021-08-07
- **Links**: ~~[Chrome Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1237686)~~, [Firefox Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1724602)

## Web extension content scripts don't run on certain about:blank popups
* **Browser**: Firefox
* **Date**: 2021-08-16
* **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1726068)

- **Browser**: Firefox
- **Date**: 2021-08-16
- **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1726068)

## Touch events report incorrect clientX on wide pages with writing-mode:vertical-rl
* **Browser**: Chrome
* **Date**: 2022-01-31
* **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1292815)

- **Browser**: Chrome
- **Date**: 2022-01-31
- **Links**: [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1292815)

## Chrome extensions can't auto-play media from an embedded extension frame
* **Browser**: Chrome
* **Date**: 2022-04-03
* **Links**: [Demo](https://github.com/toasted-nutbread/chrome-extension-audio-autoplay-bug), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1312816)

- **Browser**: Chrome
- **Date**: 2022-04-03
- **Links**: [Demo](https://github.com/toasted-nutbread/chrome-extension-audio-autoplay-bug), [Report](https://bugs.chromium.org/p/chromium/issues/detail?id=1312816)

## DOMException.data sometimes throws error on assignment
* **Browser**: Firefox
* **Date**: 2022-06-25
* **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1776555)

- **Browser**: Firefox
- **Date**: 2022-06-25
- **Links**: [Report](https://bugzilla.mozilla.org/show_bug.cgi?id=1776555)
16 changes: 8 additions & 8 deletions docs/permissions.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# Yomitan Permissions

* `<all_urls>` <br>
- `<all_urls>` <br>
Yomitan requires access to all URLs in order to run scripts to scan text and show the definitions popup,
request audio for playback and download, and connect with Anki.

* `storage` and `unlimitedStorage` <br>
- `storage` and `unlimitedStorage` <br>
Yomitan uses storage permissions in order to save extension settings and dictionary data.
`unlimitedStorage` is used to help prevent web browsers from unexpectedly
deleting dictionary data.

* `declarativeNetRequest` <br>
- `declarativeNetRequest` <br>
Yomitan uses this permission to ensure certain requests have valid and secure headers.
This sometimes involves removing or changing the `Origin` request header,
as this can be used to fingerprint browser configuration.

* `scripting` <br>
- `scripting` <br>
Yomitan needs to inject content scripts and stylesheets into webpages in order to
properly display the search popup.

* `offscreen` _(Chrome only)_ <br>
- `offscreen` _(Chrome only)_ <br>
Yomitan uses this permission to create a secondary backend document that has DOM access, given that Manifest v3
service workers do not. Service workers can then reach out to out to this document in order to complete
actions that require access to DOM APIs, such as any that require clipboard access.

* `clipboardWrite` <br>
- `clipboardWrite` <br>
Yomitan supports simulating the `Ctrl+C` (copy to clipboard) keyboard shortcut
when a definitions popup is open and focused.

* `clipboardRead` _(optional)_ <br>
- `clipboardRead` _(optional)_ <br>
Yomitan supports automatically opening a search window when Japanese text is copied to the clipboard
while the browser is running, depending on how certain settings are configured.
This allows Yomitan to support scanning text from external applications, provided there is a way
to copy text from those applications to the clipboard.

* `nativeMessaging` _(optional, unavailable on Firefox for Android)_ <br>
- `nativeMessaging` _(optional, unavailable on Firefox for Android)_ <br>
Yomitan has the ability to communicate with an optional native messaging component in order to support
parsing large blocks of Japanese text using
[MeCab](https://en.wikipedia.org/wiki/MeCab).
Expand Down
Loading

0 comments on commit 97c5c74

Please sign in to comment.