Closed KiRa937 closed 2 years ago
Tested using your settings and it seems to work for me. Do you see any error in the popup after adding the card?
For debugging, you could try adding the following template:
{{#*inline "test2"}}{{#dumpObject}}{{{.}}}{{/dumpObject}}{{/inline}}
And then set one of the fields to {test2}
, generate a card, and share what this field value outputs.
No errors.
Indeed the audio file name is null in that JSON data, but it's unclear why. It would have to come from here somewhere: https://github.com/FooSoft/yomichan/blob/756cfc027696901f0afc9b84bb439c67c8b620ad/ext/js/background/backend.js#L1784-L1817
For more debugging:
CORS error: MissingAllowOriginHeader
Can you click on that entry and then open the Headers tab on the right and screenshot all of it's content?
Here's console just in case.
So interestingly, your request doesn't look all that different from what I'm seeing, aside from not showing the request headers, probably due to the error. I also don't have the Access-Control-Allow-Origin
header. A few users have had similar issues before where the see a different, strange behaviour that nobody else has, so there may be a configuration difference in Chrome which is causing yours to behave differently.
I can try to make a debug release with a fix which might address the issue, but I'm not sure if it will work or not.
I've installed Firefox with Yomichan. The audio imported on the first try. So yeah, it's definitely Chrome problem.
I've created a branch which I've added some debugging to, to see where the issue might be occurring. https://github.com/toasted-nutbread/yomichan/commits/test-issue-2157
Here is a dev build: yomichan-chrome-dev-944c408888a91bc58c14c882c576732a69a7b231.zip
You can install it by opening chrome://extensions/ and dragging the .zip onto the window. Then, go through the same process of opening the console for the background.html tab and try adding a card + audio to Anki. Share a screenshot what info is logged after clicking the "▸" to expand any {...}
objects.
Got the dev build. I've imported my old settings and installed the dictionaries. Made a card, it has audio now. On the first try. Screenshot:
I think I've got it! My extension was setup with Site access On click. Then I've changed it to All sites and now my extension imports audio.
Recreated it on the dev build with Site access On click.
Nice find, thanks for helping debug this! I believe Chrome is trying to move all extensions towards using that setting as the default, so it's helpful to know that it can cause this. Leave this issue open, I'll try to set up an error message with more information about the issue in case other users encounter this.
Audio download failed due to possible extension permissions error. More info
Description Hi! I've set up the Yomichan extension with Anki mining deck, but Anki cards are made without audio.
I've followed this guide to setup Yomichan: got the extension, dictionaries, AnkiConnect, template mining deck and guide's handlebars. Yomichan itself works fine and I can hear audio from the pop ups. But when I add the card, there is nothing in the Audio field. I'm also using mpv script from the same site and it imports subtitles' audio just fine.
I've tried recreating cards over and over - nothing. Double checked "{audio}" in the field - nothing. Checked both Card and Field of the deck - everything is in place. I've used Jisho and both of JPods as audio sources without TtS - nothing. I've tried adding 読む and 人 (these definitely should have audio, right?) - nothing. I've tried default handlebars just in case - nothing.
Browser version Chrome 101.0.4951.67 (Official Build) (64-bit)
Yomichan version Yomichan 22.4.4.0
Exported settings file yomichan-settings-2022-05-22.zip