Skip to content

WebView: Add an option to load local resource from the app bundle #505

Description

@pilwon

<WebView/> currently only supports url prop to control what content to load in the web view.

We need an option to load local resource (mainly html but could be others too) from the application bundle.

We could either introduce a new prop for that or reuse url and do some magic conversion. For example, local://<path>.<ext> can be automatically converted to file:///<converted-url>.

NSURL *convertedURL = [[NSBundle mainBundle] URLForResource:@"<path>" withExtension:@"<ext>"];

(Use case: #497)


[UPDATE]

As @nicklockwood mentioned in his comment #505 (comment), this works out of box by simply setting a relative file path to url prop. (ex: index.html)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions