Skip to content

Conversation

@geraintluff
Copy link
Contributor

@geraintluff geraintluff commented Oct 28, 2025

Based on using the extension for a while, and talking to other devs: it's common for webview resources to be included in the binary itself, and served from memory. An extension which only supports resources served from disk doesn't cover a sufficient range of situations.

Although this change adds another function, it simplifies the spec for relative URLs. Instead of dealing with "bundle resource directory" (which isn't defined for all platforms), relative URLs are handled by a custom GET-only resource provider. Whether these resources are from the binary's data or a bundle/etc. is up to the plugin. The plugin can still return file:// URIs if it prefers.

This poses no problem for native webviews, and should be possible (if awkward) for <iframe>s.

@geraintluff geraintluff marked this pull request as ready for review October 28, 2025 15:00
@abique abique merged commit f03bf62 into free-audio:next Oct 29, 2025
4 checks passed
abique added a commit that referenced this pull request Oct 29, 2025
* Start `clap.web` draft

* Clarified `web_start` URL resolution ("bundle resource" directory depends on package format)

* `web` -> `webview`

* Move everything to `[main-thread]` except `is_open()`, add `clap.gui` API constant

* Correct include in `all.h`

* Remove `is_open()`, since this can be known from `clap.gui`.

* `provide_starting_uri` comment since bundles aren't always defined

* Bump webview draft to `/2` since I'm already using the `/1` for stuff

* Separate URI length-query function

* Single method for length/contents checks

* Allow hosts to rewrite `file:` URLs

* `clap.webview/3`: add `.get_resource()` function for serving from memory

---------

Co-authored-by: Alexandre Bique <[email protected]>
abique pushed a commit that referenced this pull request Nov 3, 2025
abique pushed a commit that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants