Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: After upgrading to 2.18.0, my custom JavaScript is not working, but it works on AnkiMobile (iOS) and Anki on Windows 11 #16403

Closed
5 tasks done
inherithandle opened this issue May 15, 2024 · 5 comments

Comments

@inherithandle
Copy link

Checked for duplicates?

  • This issue is not a duplicate

Does it also happen in the desktop version?

  • This bug does not occur in the latest version of Anki

What are the steps to reproduce this bug?

  1. Upgrade AnkiDroid to version 2.18.0.
  2. Create or open an Anki card that uses custom JavaScript, specifically wavesurfer.js for audio navigation and waveform display.
  3. Attempt to use the audio navigation and waveform display functionality.

Expected behaviour

expected to show me waveform, but waveform is missing.

Actual behaviour

The custom JavaScript does not work, and the audio navigation and waveform display functionality is not operational on AnkiDroid version 2.18.0. This issue does not occur on AnkiMobile on iOS or Anki on Windows 11.

Debug info

Ankidroid 2.18.0

(Optional) Anything else you want to share?

No response

Research

  • I am reporting a bug specific to AnkiDroid (Android app)
  • I have checked the manual and the FAQ and could not find a solution to my issue
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
Copy link

welcome bot commented May 15, 2024

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

@BrayanDSO
Copy link
Member

Hello there. Could you send a zipped .apkg file with a card and the corresponding js file affected by it

@inherithandle
Copy link
Author

here is apkg file and js file. please refer to the card that says "In middle school, 74% of the girls express science, technology as part of their interests," on the back.

apkg:
https://drive.google.com/file/d/1Y2MokGoR6WdOxX0l6LyyaOm2ZMM-1_4v/view?usp=drive_link

wavesurfer.js
https://drive.google.com/file/d/1-AL8oBPURpO3Eybs5vKz6ImxVB9X9U-1/view?usp=drive_link

@BrayanDSO
Copy link
Member

2.17 used a different way to load files, but after noticing that it was considerably slower, we reverted back to the approach of 2.16.

That approach isn't compatible with Javascript's fetch API, and it's either that or loading media several times slower. It can be easily replaced with XMLHttpRequest, so that's what I suggest

Here's a modified version of your js file.

js.zip

If it doesn't work, ask for help on Discord or the forums

@inherithandle
Copy link
Author

@BrayanDSO
your javascript file does not work for both ankimobile (ios) and anki on ubuntu linux. are you sure about this? can you please check it again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants