New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 688888 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Fix scope computation when start URL ends in '/'

Project Member Reported by pkotw...@chromium.org, Feb 6 2017

Issue description

Btw, if { "scope": "/" } on https://cnet.com/tech-today/manifest.json then it should become https://cnet.com

{ "scope": "./" on the other hand would become https://cnet.com/tech-today/ as relative urls are relative to the manifest location.

I believe it is currently defined relative to manifest location and not start_url

--
4. Let scope URL be a new URL using value as input and manifest URL as the base URL.
--

> new URL("index.html", "https://i.rocks/manifest/manifest.json").href
< "https://i.rocks/manifest/index.html"

> new URL("/", "https://i.rocks/manifest/manifest.json").href
< "https://i.rocks/"

> new URL("./", "https://i.rocks/manifest/manifest.json").href
< "https://i.rocks/manifest/"

This bug is about how we handle scope when the scope is undeclared. I think that Chrome correctly handles scope when scope is declared.

Thank you for the w3c spec links
Owner: pkotw...@chromium.org
Status: Started (was: Untriaged)
Cc: sbirch@chromium.org dominickn@chromium.org pkotw...@chromium.org hartma...@chromium.org
 Issue 694646  has been merged into this issue.
Owner: dominickn@chromium.org
I have a fix in progress for this.
Project Member

Comment 7 by bugdroid1@chromium.org, Feb 22 2017

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

commit 4141e5db756f115ae51c31f71d33d6c3a8422638
Author: dominickn <dominickn@chromium.org>
Date: Wed Feb 22 23:49:08 2017

Do not drop the final web app scope path component if it ends with a slash.

This CL updates the web app scope computation. The current computation
drops the final component of the path if there is more than one
component. For web apps which have a start URL that ends in a folder,
this removes the containing folder, resulting in an overly broad scope.
For instance, https://example.com/today/ would end up with a scope
over all of https://example.com under this scheme.

Instead, we refine the computation by not dropping the final path
component if the path ends with a slash. This indicates that the final
component is a directory which should be retained. Otherwise, a lack of
a slash at the end of the path signals a file, which we remove to
extract the containing directory.

BUG= 688888 

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

[modify] https://crrev.com/4141e5db756f115ae51c31f71d33d6c3a8422638/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
[modify] https://crrev.com/4141e5db756f115ae51c31f71d33d6c3a8422638/chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java

Status: Fixed (was: Started)

Sign in to add a comment