Closed InnovateAsterisk closed 3 weeks ago
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Is your feature request related to a problem? If so, Please describe. We would like to be able to load JavaScript Libraries like JQuery etc directly from local assets of the project rather than the CDN location.
Typically we have the webview navigate to say
https://example.com/index.php
, this serves custom content from our server. However we make use of various JS libraries. eg<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js"></script>
, however we cannot load the scripts withfile://.. /jquery-3.7.1.slim.min.js
even ifallowFileAccess
is set totrue
as the base URL is not set tofile://
(as per https://github.com/react-native-webview/react-native-webview/issues/1786)We feel that this would greatly improve our user experience as the load time and network resources would be dramatically reduced.
Describe the solutions you came up with For now we can only load via the network. We could possibly look at using a service worker, and implement fetch cache, but this would not help the first load.
Additional context We are busy converting an existing Android & iOS apps, to a single React Native App, and both Android and iOS have mechanisms for intercepting the url being loaded and can serve a local resource in its place.