New issue
Advanced search Search tips

Issue 709059 link

Starred by 0 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

location.assign(invalid-url) should not start navigation

Project Member Reported by srikanthg@chromium.org, Apr 6 2017

Issue description

App Version: 59.0.3064.0 canary
iOS Version: 10.3, 10.2, 9.3.5
Device: iPhone7,  iPad
URL: 

This is originally reported for desktop https://bugs.chromium.org/p/chromium/issues/detail?id=527290

window.location.assign("//") or window.location.replace("//") opens a new tab with about:blank.
These methods shouldn't start a navigation and throw an error.

Code snippet:
<br><div onclick="test()"><h1>Test</div>
  <script>
    function test() {
      window.location.assign("//")
    }
  </script>

Actual Result: Tab navigated to about:blank 
Expected Result: No navigation, No Error

Number of times you were able to reproduce: 5/5
Bug reproducible after clean install: YES
Bug reproducible after clearing cache and cookies: YES
Observed behavior in Chrome Mobile on Android: NO (No error, No Navigation)
Check for similar behavior on Dolphin/Safari/Atomic:
Safari: Alert saying "Safari cannot open the webpage because the address is invalid", No Navigation
Firefox: Alert saying "Firefox cannot open the webpage because it has an invalid address", No Navigation

Bug reproducible on current stable build (App Version, iOS Version): M57 Yes
Bug reproducible on the current beta channel build (App Version, iOS Version): M58 Yes
 
Labels: found-in-canary found-in-M59
Components: UI>Browser>Navigation
Labels: -Pri-2 Pri-3
Owner: kkhorimoto@chromium.org
Status: Assigned (was: Untriaged)
Kurt, is this related to https://codereview.chromium.org/2397623002/patch/40001/50001 ?
Status: Started (was: Assigned)
https://codereview.chromium.org/2799953002
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/45b26c61d1eec665cd55bc17d6c0799b092d66e7

commit 45b26c61d1eec665cd55bc17d6c0799b092d66e7
Author: kkhorimoto <kkhorimoto@chromium.org>
Date: Fri Apr 07 00:13:20 2017

Treat loads of invalid URLs as no-ops unless triggered by window.open.

The HTML5 spec indicates that a load of an invalid URL via links or the
window.location API should be a no-op.  However, window.open calls
with an invalid URL should still create a new window, but pointed to
about:blank.

BUG= 709059 

Review-Url: https://codereview.chromium.org/2799953002
Cr-Commit-Position: refs/heads/master@{#462700}

[modify] https://crrev.com/45b26c61d1eec665cd55bc17d6c0799b092d66e7/ios/testing/data/http_server_files/window_location.html
[modify] https://crrev.com/45b26c61d1eec665cd55bc17d6c0799b092d66e7/ios/testing/data/http_server_files/window_location.js
[modify] https://crrev.com/45b26c61d1eec665cd55bc17d6c0799b092d66e7/ios/web/navigation/window_location_inttest.mm
[modify] https://crrev.com/45b26c61d1eec665cd55bc17d6c0799b092d66e7/ios/web/public/web_state/web_state.h
[modify] https://crrev.com/45b26c61d1eec665cd55bc17d6c0799b092d66e7/ios/web/web_state/ui/crw_web_controller.mm

Status: Fixed (was: Started)
Status: Verified (was: Fixed)
Issue is fixed now. No action performed when performing window.open with invalid URL.
Device: iPhone7, iOS: 10.3.2, M60.0.3087.0 canary

Sign in to add a comment