Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a relative URL of a resource in a bundle. #647

Closed
hayatoito opened this issue Apr 8, 2021 · 5 comments
Closed

Support a relative URL of a resource in a bundle. #647

hayatoito opened this issue Apr 8, 2021 · 5 comments

Comments

@hayatoito
Copy link
Collaborator

hayatoito commented Apr 8, 2021

It might be worth considering to support a relative URL in the bundle format.

I've heard this feature request from several people. I've searched an existing issue, but I couldn't find one so let me file an issue.

Use cases:

Regarding subresource loading use case, we use the following syntax in the main doc:

<link rel=webundle href=https://example.com/app/bundle.wbn resources=".....">

Because we have path restriction, the resources in the bundle must start with https://example.com/app/, such as:

It seems a bit redundant. If we support a relative URL, each subresource doesn't have to include a redundant common prefix, and can be:

  • ./top.js
  • ./util1.js
  • ./util2.js
  • ...

We have to decide on which base a relative URL should be resolved. For subresource loading use cases, it's clear.
For other use cases, TBD.

The other benefits are:

@hayatoito
Copy link
Collaborator Author

hayatoito commented Apr 8, 2021

#617 can be related. We need to make primary URL optional.

@jyasskin
Copy link
Member

jyasskin commented Apr 8, 2021

Yep, I think we do this by either

  1. putting the base URL in a section (possibly one holding a map of several metadata values), or
  2. using the bundle's URL as the base.
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 9, 2021
This CL changes WebBundleParser to support relative URLs in the index
section. And uses the web bundle's URL as the base URL for
SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 9, 2021
This CL changes WebBundleParser to support relative URLs in the index
section. And uses the web bundle's URL as the base URL for
SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 10, 2021
This CL changes WebBundleParser to support relative URLs in the index
section. And uses the web bundle's URL as the base URL for
SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 10, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
@horo-t
Copy link
Collaborator

horo-t commented Sep 10, 2021

Hi.

I created a PR to support the second idea "using the bundle's URL as the base." in @jyasskin 's comment in subresource bundle.

I think we can introduce a base section which can override the base URL in future. But even so, I think it is reasonable to use the bundle's URL as the base URL which can be overridden by the base section.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 13, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
@hayatoito
Copy link
Collaborator Author

hayatoito commented Sep 13, 2021

Thanks!
Yes, I think we can agree on the "using the bundle's URL as the base".
While I can appreciate the PR, we probably want to wait for a resolution of wpack-wg/bundled-responses#14.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 14, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 16, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 22, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 22, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 22, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 24, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 24, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}
pull bot pushed a commit to Yannic/chromium that referenced this issue Sep 24, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 4, 2021
…ubresourceWebBundles feature, a=testonly

Automatic update from web-platform-tests
Support relative URL in Web Bundle for SubresourceWebBundles feature

This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}

--

wpt-commits: 68c75f6da95e3da84c83eb4930ba5a5c2341637a
wpt-pr: 30416
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 6, 2021
…ubresourceWebBundles feature, a=testonly

Automatic update from web-platform-tests
Support relative URL in Web Bundle for SubresourceWebBundles feature

This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}

--

wpt-commits: 68c75f6da95e3da84c83eb4930ba5a5c2341637a
wpt-pr: 30416
@hayatoito
Copy link
Collaborator Author

Fixed. Now we support a relative URL.

Gabisampaio pushed a commit to Gabisampaio/wpt that referenced this issue Nov 18, 2021
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
This CL changes WebBundleParser to support relative URLs in the primary
URL, manifest and index section. And uses the web bundle's URL as the
base URL for SubresourceWebBundles feature.

Bug: 1247939, WICG/webpackage#647
Change-Id: Ie41125c293791d9209f94e59e5c9c8af3ac9778f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150318
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924647}
NOKEYCHECK=True
GitOrigin-RevId: 17698fb7dfb32500eaa631a821082128a2f3faa7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants