Skip to content

Set origin with NavigateToString #530

Open
@jhandley

Description

@jhandley

When setting HTML to display using ICoreWebView2::NavigateToString I would like to be able set the origin URL used by the browser for the page like you can do with the Android WebView method loadDataWithBaseURL

The origin URL would be used as the base for relative paths for resources. This allows you to set an HTML string that refers to images, scripts and stylesheets that are stored separately. In my case, on Android I set the base URL to a file:// and store images and stylesheets in that directory on disk.

I tried to simulate this using AddWebResourceRequestedFilter but the events only fire for http/https URLs so relative paths in HTML set by NavigateToString do not trigger these events.

I will try to make this work by writing out the HTML to a temporary file and use Navigate with a file:// url but I'd much rather avoid that using the same technique that I'm using on Android.

AB#29796279

Metadata

Metadata

Assignees

Labels

feature requestfeature requesttrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions