Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening 'file://' URLs #114

Closed
divan opened this issue Jun 10, 2019 · 5 comments
Closed

Opening 'file://' URLs #114

divan opened this issue Jun 10, 2019 · 5 comments
Labels

Comments

@divan
Copy link

divan commented Jun 10, 2019

Hi,

first of all, thanks for the fantastic plugin – it's truly the best web browser Flutter plugin out there!

So I need to open both "normal" urls (http://) and local files (file://). Currently I'm testing only on iOS and the problem I see is that opening local file via file:// URL fails on the device (but works in a simulator). Error is The operation couldn't be completed. Operation not permitted.

I've read in docs that for opening local files we should use loadHTMLString:

Use the loadHTMLString(:baseURL:) method to begin loading local HTML files or the load(:) method to begin loading web content.

This, however, requires a lot of hassle with opening and reading file from FS, figuring out correct MIME type (I need just PDFs and Images, but everything that webkit supports should work ideally) and so on.

I initially tried initialFile option, until read that it's actually initialAsset (rename, perhapse?). So maybe it's worth implement initialFile for local files (not only assets)?

Or maybe there is a better way to load local resources? (I don't have much experience with mobile dev, so may be missing some obvious things)

Thanks in advance!

@micsanbr
Copy link

I can confirm this. I am able to load local files in Android (downloaded from firebase to the application directory on the device) using initialUrl, but the same does not work on iOS.
Error: (1) The operation couldn't be completed. Operation not permitted.

This was referenced Jul 6, 2020
@shodafl
Copy link

shodafl commented Nov 16, 2021

@micsan13br Hi! how do you import local files on android?

@micsanbr
Copy link

@shodafl my reply to this issue goes back to 2019. I don't know if this still applies to the latest version or what was this about at all.

Copy link

github-actions bot commented Oct 7, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 7, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants