[
https://issues.apache.org/jira/browse/CB-10939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthew Ma updated CB-10939:
----------------------------
Priority: Blocker (was: Minor)
Description:
The
[injectview|https://www.npmjs.com/package/cordova-plugin-fastrde-injectview]
plugin looks great to me because I want to open an external website.
The plugin injects cordova and its plugin js into the webview as inline script.
I got device ready event and the cordova demo app looks good.
However, I found out I can't not use things like navigator.camera.getPicture or
navigator.notification.alert. After ruling out common mistake and I start to
step the code.
It turns out the bridgesecret in the js is 0 so it doesn't pass the
{code:java}
if (!verifySecret("exec()", bridgeSecret)) {
return null;
}
{code}
in CordovaBridge.java. If I comment out these three lines, things may works
fine. but some callback such as camera won't fire.
If I don't use remote website but use local www, this works fine.(without
remove the injectView plugin).
I think the issue has something to do with the code injection plugin.
Any thought?
was:
The
[injectview|https://www.npmjs.com/package/cordova-plugin-fastrde-injectview]
plugin looks great to me because I want to open an external website.
The plugin injects cordova and its plugin js into the webview as inline script.
I got device ready event and the cordova demo app looks good.
However, I found out I can't not use things like navigator.camera.getPicture or
navigator.notification.alert. After ruling out common mistake and I start to
step the code.
It turns out the bridgesecret in the js is 0 so it doesn't pass the
{code:java}
if (!verifySecret("exec()", bridgeSecret)) {
return null;
}
{code}
in CordovaBridge.java. If I comment out these three lines, things works fine.
If I don't use remote website but use local www, this works fine.(without
remove the injectView plugin) Also, I DON'T have this problem on my actual
android lollipop phone, where the bridgesecret is a good random number. Only on
emulators such as AVD and Visual Studio Android Emulator.
So, this issue only happens on emulator with the injected inline javascript
plugin.
Any thought?
Summary: BridgeSecret is 0 when cordova js is injected as inline script
(was: BridgeSecret is 0 when cordova js is injected as inline script on
emulators)
> BridgeSecret is 0 when cordova js is injected as inline script
> --------------------------------------------------------------
>
> Key: CB-10939
> URL: https://issues.apache.org/jira/browse/CB-10939
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 5.1.1
> Environment: Cordova 6.0.0
> cordova android 5.1.1
> [cordova-plugin-fastrde-injectview|https://www.npmjs.com/package/cordova-plugin-fastrde-injectview]
> plugin.
> Reporter: Matthew Ma
> Priority: Blocker
> Labels: android, cordova-6.0.0
>
> The
> [injectview|https://www.npmjs.com/package/cordova-plugin-fastrde-injectview]
> plugin looks great to me because I want to open an external website.
> The plugin injects cordova and its plugin js into the webview as inline
> script. I got device ready event and the cordova demo app looks good.
> However, I found out I can't not use things like navigator.camera.getPicture
> or navigator.notification.alert. After ruling out common mistake and I start
> to step the code.
> It turns out the bridgesecret in the js is 0 so it doesn't pass the
> {code:java}
> if (!verifySecret("exec()", bridgeSecret)) {
> return null;
> }
> {code}
> in CordovaBridge.java. If I comment out these three lines, things may works
> fine. but some callback such as camera won't fire.
> If I don't use remote website but use local www, this works fine.(without
> remove the injectView plugin).
> I think the issue has something to do with the code injection plugin.
> Any thought?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]