mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-18 22:52:54 +08:00
Remove redundant whitelist checks
This commit is contained in:
parent
167e283450
commit
a8bec4ec9c
@ -351,10 +351,7 @@ public class CordovaActivity extends Activity {
|
|||||||
// If errorUrl specified, then load it
|
// If errorUrl specified, then load it
|
||||||
final String errorUrl = preferences.getString("errorUrl", null);
|
final String errorUrl = preferences.getString("errorUrl", null);
|
||||||
CordovaUriHelper helper = new CordovaUriHelper(this.cordovaInterface, appView);
|
CordovaUriHelper helper = new CordovaUriHelper(this.cordovaInterface, appView);
|
||||||
if ((errorUrl != null) &&
|
if ((errorUrl != null) && (!failingUrl.equals(errorUrl)) && (appView != null)) {
|
||||||
(!failingUrl.equals(errorUrl)) &&
|
|
||||||
(appView != null && helper.shouldAllowNavigation(errorUrl))
|
|
||||||
) {
|
|
||||||
// Load URL on UI thread
|
// Load URL on UI thread
|
||||||
me.runOnUiThread(new Runnable() {
|
me.runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -171,11 +171,8 @@ public class CordovaBridge {
|
|||||||
// Protect against random iframes being able to talk through the bridge.
|
// Protect against random iframes being able to talk through the bridge.
|
||||||
// Trust only file URLs and pages which the app would have been allowed
|
// Trust only file URLs and pages which the app would have been allowed
|
||||||
// to navigate to anyway.
|
// 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:") ||
|
if (origin.startsWith("file:") ||
|
||||||
origin.startsWith(this.appContentUrlPrefix) ||
|
origin.startsWith(this.appContentUrlPrefix) ||
|
||||||
(origin.startsWith("http") && loadedUrl.startsWith(origin)) ||
|
|
||||||
helper.shouldAllowNavigation(origin)) {
|
helper.shouldAllowNavigation(origin)) {
|
||||||
// Enable the bridge
|
// Enable the bridge
|
||||||
int bridgeMode = Integer.parseInt(defaultValue.substring(9));
|
int bridgeMode = Integer.parseInt(defaultValue.substring(9));
|
||||||
|
Loading…
Reference in New Issue
Block a user