-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: Fix image editor fails to load on older WebView versions
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.
- Loading branch information
1 parent
6048f96
commit c77383d
Showing
5 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/app-mobile/components/NoteEditor/ImageEditor/js-draw/polyfills.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// .replaceChildren is not supported in Chromium 83, which is the default for Android 11 | ||
// (unless auto-updated from the Google Play store). | ||
HTMLElement.prototype.replaceChildren ??= function(this: HTMLElement, ...nodes: Node[]) { | ||
while (this.children.length) { | ||
this.children[0].remove(); | ||
} | ||
|
||
for (const node of nodes) { | ||
this.appendChild(node); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters