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

Android: Fix clicking "Draw picture" results in blank screen with very old WebView versions #11604

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

Android 11 ships with a WebView based on Chromium 83. This commit:

  1. adds js-draw to the list of packages that need to be transpiled with babel before creating injectedJs
  2. adds a polyfill for HTMLElement.replaceChildren.

Note: Some devices upgrade the system WebView version (e.g. through the Google PlayStore). As such, before this pull request, the "Draw picture" feature may work correctly on many Android 11 and older devices.

Testing plan

  1. Create an Android 11 emulator (choose the system image without access to the Play Store).
  2. Run Joplin.
  3. Create a new note.
  4. Click "Draw picture".
  5. Draw something.
  6. Click "save".
  7. Verify that the drawing is added to the note.
  8. Click the edit button for the drawing.
  9. Verify that the drawing is opened in the image editor.

Android 11 ships with a WebView based on Chromium 83. Although some devices update their WebView version through the PlayStore, not all devices do.
This commit fixes an issue that prevented the image editor from running in these older WebView versions.
Comment on lines -70 to -72
if (isJsFile) {
console.log('Compiling with Babel:', value);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After adding js-draw to the list of libraries to transiple, this line creates a large amount of console output (one line of output per referenced js-draw source file).

@laurent22 laurent22 merged commit 633d87e into laurent22:dev Jan 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants