Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into update-dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Nov 3, 2023
2 parents 5e10b67 + b64f51c commit ec62375
Show file tree
Hide file tree
Showing 23 changed files with 684 additions and 726 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@
},
{
"files": [
"integration.spec.js",
"playwright-util.js",
"visual.spec.js"
],
"env": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-prerelease-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ jobs:
playwright:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS: 1
steps:
- name: Remove all fonts
run: rm -rf /usr/share/fonts

- uses: actions/checkout@v4

- name: Install CJK fonts
uses: awalsh128/cache-apt-pkgs-action@1850ee53f6e706525805321a3f2f863dcf73c962 # v1.3.0
uses: awalsh128/cache-apt-pkgs-action@44c33b32f808cdddd5ac0366d70595ed63661ed8 # v1.3.1
with:
packages: fonts-ipafont-mincho
execute_install_scripts: true

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: ".node-version"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-firefox-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
git commit -a -m "${{ github.ref_name }}"
- name: Push changes
uses: ad-m/github-push-action@29f05e01bb17e6f28228b47437e03a7b69e1f9ef # pin@master
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # pin@master
with:
branch: metadata

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.format.enable": true
"eslint.format.enable": true,
"playwright.env": {
"PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS": 1
}
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Yomitan provides advanced features not available in other browser-based dictiona
- On-demand audio playback for select dictionary definitions.
- Kanji stroke order diagrams are just a click away for most characters.
- Custom search page for easily executing custom search queries.
- Support for multiple dictionary formats including [EPWING](https://ja.wikipedia.org/wiki/EPWING) via the [Yomichan Import](https://foosoft.net/projects/yomichan-import) tool.
- Support for multiple dictionary formats including [EPWING](https://ja.wikipedia.org/wiki/EPWING) via the [Yomitan Import](https://github.com/themoeway/yomitan-import) tool.
- Automatic note creation for the [Anki](https://apps.ankiweb.net/) flashcard program via the [AnkiConnect](https://foosoft.net/projects/anki-connect) plugin.
- Clean, modern code makes it easy for developers to [contribute](https://github.com/themoeway/yomitan/blob/master/CONTRIBUTING.md) new features.

Expand Down Expand Up @@ -111,8 +111,8 @@ form (e.g. `{{set "key" "value"}}`). The default templates and helper documentat

There are several free Japanese dictionaries available for Yomitan, with two of them having glossaries available in
different languages. You must download and import the dictionaries you wish to use in order to enable Yomitan
definition lookups. If you have proprietary EPWING dictionaries that you would like to use, check the [Yomichan
Import](https://foosoft.net/projects/yomichan-import) page to learn how to convert and import them into Yomitan.
definition lookups. If you have proprietary EPWING dictionaries that you would like to use, check the [Yomitan
Import](https://github.com/themoeway/yomitan-import) page to learn how to convert and import them into Yomitan.

Be aware that non-English dictionaries contain fewer entries than their English counterparts. Even if your primary
language is not English, you may consider also importing the English version for better coverage.
Expand Down Expand Up @@ -188,8 +188,8 @@ similar to the ones pictured below. These dictionaries are often sought after by
and excellent coverage of the Japanese language.

Unfortunately, as most of the dictionaries released in this format are proprietary, they are unable to be bundled with
Yomitan. Instead, you will need to procure these dictionaries yourself and import them using [Yomichan
Import](https://foosoft.net/projects/yomichan-import). Check the project page for additional details.
Yomitan. Instead, you will need to procure these dictionaries yourself and import them using [Yomitan
Import](https://github.com/themoeway/yomitan-import). Check the project page for additional details.

![Pocket EPWING dictionaries](img/epwing-devices.jpg)

Expand Down
67 changes: 27 additions & 40 deletions dev/data/manifest-variants.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"clipboardWrite",
"unlimitedStorage",
"declarativeNetRequest",
"webRequest",
"scripting",
"offscreen"
],
Expand Down Expand Up @@ -171,6 +170,27 @@
}
]
},
{
"name": "chrome-playwright",
"inherit": "chrome-dev",
"fileName": "yomitan-chrome-playwright.zip",
"modifications": [
{
"action": "remove",
"path": [
"optional_permissions"
],
"item": "clipboardRead"
},
{
"action": "add",
"path": [
"permissions"
],
"items": ["clipboardRead"]
}
]
},
{
"name": "firefox",
"inherit": "base",
Expand Down Expand Up @@ -230,41 +250,12 @@
"gecko": {
"id": "{cb7c0bec-7085-4f84-8422-7b55a7c4467c}",
"strict_min_version": "115.0"
},
"gecko_android": {
"strict_min_version": "115.0"
}
}
},
{
"action": "remove",
"path": [
"optional_permissions"
],
"item": "nativeMessaging"
},
{
"action": "add",
"path": [
"permissions"
],
"items": [
"nativeMessaging"
]
},
{
"action": "add",
"path": [
"permissions"
],
"items": [
"webRequestBlocking"
]
},
{
"action": "remove",
"path": [
"permissions"
],
"item": "declarativeNetRequest"
},
{
"action": "remove",
"path": [
Expand Down Expand Up @@ -344,13 +335,6 @@
],
"item": "clipboardRead"
},
{
"action": "remove",
"path": [
"permissions"
],
"item": "webRequestBlocking"
},
{
"action": "remove",
"path": [
Expand Down Expand Up @@ -382,6 +366,9 @@
],
"excludeFiles": [
"sw.js",
"offscreen.html",
"js/background/offscreen.js",
"js/background/offscreen-main.js",
"js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
Expand Down
23 changes: 6 additions & 17 deletions docs/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,16 @@
`unlimitedStorage` is used to help prevent web browsers from unexpectedly
deleting dictionary data.

* `webRequest` <br>
Yomichan uses this permission to collect audio or create Anki notes using
[AnkiConnect](https://ankiweb.net/shared/info/2055492159).
It is also required to surface error information from failed requests.

* `webRequestBlocking` _(Firefox only)_ <br>
Yomichan 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.

* `declarativeNetRequest` _(Chrome only)_ <br>
* `declarativeNetRequest` <br>
Yomichan 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` _(Manifest V3 only)_ <br>
Yomichan will sometimes need to inject stylesheets into webpages in order to
* `scripting` <br>
Yomichan 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.
Expand All @@ -37,15 +27,14 @@
Yomichan supports simulating the `Ctrl+C` (copy to clipboard) keyboard shortcut
when a definitions popup is open and focused.

* `clipboardRead` (optional) <br>
* `clipboardRead` _(optional)_ <br>
Yomichan 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 Yomichan to support scanning text from external applications, provided there is a way
to copy text from those applications to the clipboard.

* `nativeMessaging` (optional on Chrome) <br>
* `nativeMessaging` _(optional, unavailable on Firefox for Android)_ <br>
Yomichan 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).
The installation of this component is optional and is not included by default.
This permission is optional on Chrome, but required on Firefox, because Firefox does not permit it to be optional.
Loading

0 comments on commit ec62375

Please sign in to comment.