cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Ma (JIRA)" <>
Subject [jira] [Created] (CB-10939) BridgeSecret is 0 when cordova is injected as inline script on emulators only
Date Wed, 23 Mar 2016 18:48:25 GMT
Matthew Ma created CB-10939:

             Summary: BridgeSecret is 0 when cordova is injected as inline script on emulators
                 Key: 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

            Reporter: Matthew Ma
            Priority: Minor

The [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 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 
if (!verifySecret("exec()", bridgeSecret)) {
    return null;
in 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? 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message