Remove redundant whitelist checks

This commit is contained in:
Ian Clelland 2015-02-11 16:19:54 -05:00
parent 167e283450
commit a8bec4ec9c
2 changed files with 1 additions and 7 deletions

View File

@ -351,10 +351,7 @@ public class CordovaActivity extends Activity {
// If errorUrl specified, then load it
final String errorUrl = preferences.getString("errorUrl", null);
CordovaUriHelper helper = new CordovaUriHelper(this.cordovaInterface, appView);
if ((errorUrl != null) &&
(!failingUrl.equals(errorUrl)) &&
(appView != null && helper.shouldAllowNavigation(errorUrl))
) {
if ((errorUrl != null) && (!failingUrl.equals(errorUrl)) && (appView != null)) {
// Load URL on UI thread
me.runOnUiThread(new Runnable() {
public void run() {

View File

@ -171,11 +171,8 @@ public class CordovaBridge {
// Protect against random iframes being able to talk through the bridge.
// Trust only file URLs and pages which the app would have been allowed
// to navigate to anyway.
// 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(this.appContentUrlPrefix) ||
(origin.startsWith("http") && loadedUrl.startsWith(origin)) ||
helper.shouldAllowNavigation(origin)) {
// Enable the bridge
int bridgeMode = Integer.parseInt(defaultValue.substring(9));