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 2020/10/23 14:40:34 UTC

[GitHub] [cordova-ios] shamsundhar opened a new issue #1011: Load html file from data directory in cordova-ios from WKWebview

shamsundhar opened a new issue #1011:
URL: https://github.com/apache/cordova-ios/issues/1011


   I am working on cordova-ios app. My App will download zip file(contains html files ex:-second_login.html) from server, then we are unzipping it in data directory. After successful unzipping, app should navigate to second_login.html. App is working fine in UIWebview with cordova-ios 5.1.1. But it is not working in cordova-ios-6.1.0 with WKWebview.
   
   Using cordova-ios-6.1.0, I downloaded and unzipped in data-directory successfully to below path.
   
   /var/mobile/Containers/Data/Application/<APPID>/Library/NoCloud/<APP_NAME>//files/www-24862240/second_login.html.
   
   
   And for loading this second_login.html, I am using document.location = "<PATH_MENTIONED_ABOVE>"
   
   Initially, we got issue in downloading zip file(Cookie sync issue), for this we have used cordova-plugin-ios-xhr plugin. then we successfully downloaded zip file.
   
   Please help me to resolve this issue. Thanks


----------------------------------------------------------------
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


[GitHub] [cordova-ios] shamsundhar commented on issue #1011: Load html file from data directory in cordova-ios from WKWebview

Posted by GitBox <gi...@apache.org>.
shamsundhar commented on issue #1011:
URL: https://github.com/apache/cordova-ios/issues/1011#issuecomment-730248901


   Already using https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix plugin to access local files. But my problem here is i have one HTML file present in data directory. I need to load that HTML into cordova webkit webview. previously in UIWebview, we used document.location ="" to navigate to that HTML. please help


----------------------------------------------------------------
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


[GitHub] [cordova-ios] AraHovakimyan commented on issue #1011: Load html file from data directory in cordova-ios from WKWebview

Posted by GitBox <gi...@apache.org>.
AraHovakimyan commented on issue #1011:
URL: https://github.com/apache/cordova-ios/issues/1011#issuecomment-729459376


   To load a local file you can use the following plugin. I hope this plugin can solve your problem. 
   
   `cordova plugin add https://github.com/AraHovakimyan/cordova-plugin-wkwebviewxhrfix`
   
   NOTE: This plugin does not depend on any other additional plugins and does not require additional permissions.


----------------------------------------------------------------
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


[GitHub] [cordova-ios] afioletov commented on issue #1011: Load html file from data directory in cordova-ios from WKWebview

Posted by GitBox <gi...@apache.org>.
afioletov commented on issue #1011:
URL: https://github.com/apache/cordova-ios/issues/1011#issuecomment-889937550


   Good morning,
   
   Did anybody solve the issue? We have the same problem - cannot change window.location to html file in cache.
   If we load file directly, document location is `'file:///private/var/containers/Bundle/Application/GUID/InMotionTestApp.app/www/Bootloader.html'`. 
   
   Attempts to set location 
   `window.location='file:///var/mobile/Containers/Data/Application/GUID/Library/Caches/1.11.00000.0000/www/Default.html'` 
   fail with 
   `2021-07-30 10:06:33.742306-0400 InMotionTestApp[2318:560700] [Loading] Received an unexpected URL from the web process
   2021-07-30 10:06:33.742441-0400 InMotionTestApp[2318:560700] [Process] 0x10202ca18 - [pageProxyID=11, webPageID=12, PID=2321] WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox
   `
   
   If I add schema and hostname to config.xml:
   
   ```
   <content src="app://localhost/Bootloader.html" />
   ...
    <preference name="scheme" value="app" />
    <preference name="hostname" value="localhost" />
   ```
   
   I do not get error in Xcode, but get error in web inspector:
   
   `Not allowed to load local resource: file:///var/mobile/Containers/Data/Application/A3E5D945-5503-4D23-A54F-C1135CE08CD8/Library/Caches/1.11.00000.0000/www/Default.html
   `
   
   @AraHovakimyan I tried to use your plugin. It did not help.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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


[GitHub] [cordova-ios] AraHovakimyan commented on issue #1011: Load html file from data directory in cordova-ios from WKWebview

Posted by GitBox <gi...@apache.org>.
AraHovakimyan commented on issue #1011:
URL: https://github.com/apache/cordova-ios/issues/1011#issuecomment-731016396


   Can you print in console your document.location by using consol.log(document.location)?
   You can try to use document.location ='www-24862240/second_login.htm';


----------------------------------------------------------------
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