You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/02/19 12:24:52 UTC

[GitHub] [cordova-plugin-inappbrowser] guycalledseven commented on a change in pull request #778: fix(ios): Allow loading of external local files from the same directory as loaded local html

guycalledseven commented on a change in pull request #778:
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/778#discussion_r579147489



##########
File path: src/ios/CDVWKInAppBrowser.m
##########
@@ -1097,7 +1097,8 @@ - (void)close
 - (void)navigateTo:(NSURL*)url
 {
     if ([url.scheme isEqualToString:@"file"]) {
-        [self.webView loadFileURL:url allowingReadAccessToURL:url];
+        NSURL* directoryURL = [url URLByDeletingLastPathComponent];
+        [self.webView loadFileURL:url allowingReadAccessToURL:directoryURL];

Review comment:
       This does not change current logic anyhow. This only enables later ios versions to load static files from `url`.
   
   Use case is - we put static content in our apps and then app reads this static content via built in webserver / directly (css files/images etc).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org