[ 
https://issues.apache.org/jira/browse/CB-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14171705#comment-14171705
 ] 

Joe Bowser edited comment on CB-7758 at 10/14/14 11:32 PM:
-----------------------------------------------------------

We don't support loading from content:// URIs from the bridge.  This can be 
found in this code that's in CordovaBridge.java

{code}
        else if (defaultValue != null && defaultValue.startsWith("gap_init:")) {
            // Protect against random iframes being able to talk through the 
bridge.
            // Trust only file URLs and the start URL's domain.
            // The extra origin.startsWith("http") is to protect against 
iframes with data: having "" as origin.
            if (origin.startsWith("file:") || (origin.startsWith("http") && 
loadedUrl.startsWith(origin))) {
                // Enable the bridge
                int bridgeMode = Integer.parseInt(defaultValue.substring(9));
                jsMessageQueue.setBridgeMode(bridgeMode);
                // Tell JS the bridge secret.
                int secret = generateBridgeSecret();
                return ""+secret;
            } else {
                Log.e(LOG_TAG, "gap_init called from restricted origin: " + 
origin);
            }
            return "";
        }
{code}


was (Author: bowserj):
We don't support loading from content:// URIs.

> gap_init called from restricted origin
> --------------------------------------
>
>                 Key: CB-7758
>                 URL: https://issues.apache.org/jira/browse/CB-7758
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.6.0
>         Environment: Android 4.3
>            Reporter: Wolfgang Flohr-Hochbichler
>            Priority: Minor
>
> Device ready event is not fired if page is loaded via content:// protocol. 
> I assume it has something to do with a security check done within 
> CordovaBridge.java which triggers the following gap_init error message.
> 10-09 10:10:18.071 16719 16719 E CordovaBridge: gap_init called from 
> restricted origin: 
> content://com.ionicframework.ionicapp795549.jsHybugger/file:///android_asset/www/index.html#/tab/dash
> 10-09 10:10:23.075 16719 16719 D CordovaLog: 
> content://com.ionicframework.ionicapp795549.jsHybugger/jshybugger.js: Line 
> 112 : deviceready has not fired after 5 seconds.
> 10-09 10:10:23.075 16719 16719 I Web Console: deviceready has not fired after 
> 5 seconds. at 
> content://com.ionicframework.ionicapp795549.jsHybugger/jshybugger.js:112



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to