-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
webview local file issue #4668
Comments
I ran your case many times and it never fail on Linux x64. |
I'm on linux x64 as well. Is it possible that I'm hitting a timing issue? e.g. When the dom is updated the file protocol hasn't been whitelisted yet. Anything I can do to further debug this issue? |
@rogerwang I enabled logging, not much info in it, perhaps it'll make more sense to you. The first log set is when the webview is working as expected. The second log set is when it's not working. I didn't change anything in between these runs. On one run it was working, on the other it wasn't. Here's the webview tag I used:
|
The log is helpful. I'll send you another version to print more logs at specific location. |
@rogerwang sounds good. thanks! |
please try this build and post the logs for both positive and negative case: |
Here you go:
|
Is the case posted in this issue exactly the one you were running? I see additional console log here:
Please attach your original case if not? |
Hey, sorry about that. I was using a slightly modified version. Below you can find the exact version I used to generate the logs. Note that the javascript lines setting webview.src were commented out during the test runs. So the only difference is the extra styling, getElementById call and two log lines.
|
nevermind. The good news is that @ghostoy is now able to reproduce it randomly in some other system. It should be very helpful to fix this. |
awesome! let me know if you need anything else on my end. |
please try this build for the fix: |
This is fixed in git and will be available in the next nightly build. |
@rogerwang the latest package you sent is working for me. Thank you! |
Hello I am also facing the same problem on my windows 10 dev machine , no matter what I do , I get : The load has aborted with error -301: ERR_DISALLOWED_URL_SCHEME when I try to load a local file, any help?? |
Creating a new issue as I couldn't reopen the existing issue, see #4425 for details.
Loading a local file with webview tag is still not working. I tested with 0.13.0, 0.13.0-sdk, 0.13.0-sdk-1, 0.13.0-rc2sdk, 0.13.0-rc4sdk and 0.14.0-rc2sdk on Linux x64. I tested with the following app:
index.html
:package.json
:When I load this app, I sometimes get the
ERR_DISALLOWED_URL_SCHEME
error and sometimes I see the contents of the webview.html. I don't have a consistent way of reproducing this. You can try to open / close nw window multiple times to verify.The second test I did was to delete the src attribute completely and try to set the value with javascript. When I do that, again I only sometimes see the content. But I never get the error even when I don't see the content. This happens with
wv.src = 'file:///xxx';
as well as withwv.setAttribute('src', 'file:///xxx');
.Finally, if I open the dev tools and set the src attribute of the webview manually, it works.
The text was updated successfully, but these errors were encountered: