fix(android) Issue #329 - Allow plugins to "exec" when on a cdvfile:// url - #356
Open
Lindsay-Needs-Sleep wants to merge 2 commits into
Open
Conversation
…e:// url in Android 4.4 (Already works properly in at least Android 6.0+)
Lindsay-Needs-Sleep
force-pushed
the
issue#329-Android4.4_cdvfile_exec
branch
from
November 7, 2019 11:47
08460fa to
ed23d19
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow plugins to exec when on a cdvfile:// url in Android 4.4 (Already works properly in at least Android 6.0+)
Platforms affected
Android
(Specifically for Android OS 4.4, maybe Android OS 5.0)
Motivation and Context
This fixes #329
(Also accidentally caused my previous pull request (PR #332) to accidentally close.)
Description
Due to different/incorrect native code in Android 4.4, the received origin onJsPrompt is "" when on a "cdvfile://" url.
So in the case that cordova-plugin-file is asked if a url should(be)Allow(ed)BridgeAccess, it will manually retrieve the url from the webView in the case that it has received the broken "" and check if it is a "cdvfile://" url.
Testing
Added the plugin as a local file to my project.
Debugged the new Android code. Walked through it.
Observed that desired result of cordova-plugin-file being able to "exec". (Other plugins were also then able to do their exec commands and fire their ready channels as well.)
And deviceready was finally fired.
Ran the manual tests, they all passed.
The automatic tests had the same failures before and after my change.
Added a new manual test which basically redirects to the same page but is a cdvfile url.
This allows you to run tests from the cdvfile url. When you open this page with an Android OS 4.4 device (before my changes), it is completely blank. After the changes, all the tests run again successfully on the cdvfile url (except those that were broken before changes).
Passed
npm run eslintChecklist
(platform)if this change only applies to one platform (e.g.(android))