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

XMLHttpRequest: Using GET on a local file is dangerous and will be disabled by default in a future Qt version #7

Open
vivien opened this issue Oct 6, 2021 · 3 comments

Comments

@vivien
Copy link

vivien commented Oct 6, 2021

qt-kiosk-browser tries to load either the first argument or "settings.json" with the file: scheme. But this triggers the following warning:

XMLHttpRequest: Using GET on a local file is dangerous and will be disabled by default in a future Qt version.Set QML_XHR_ALLOW_FILE_READ to 1 if you wish to continue using this feature.

Indeed QML_XHR_ALLOW_FILE_READ=1 qt-kiosk-browser turns the warning off, but I'm not sure that is the best solution.

I'm opening this issue for tracking.

@otavio
Copy link
Member

otavio commented Oct 7, 2021

Yes, WebEngine doesn't allow local file load. Check if using an URL works.

@vivien
Copy link
Author

vivien commented Oct 7, 2021

@otavio, I feel like you're not reading my issues.

This is not from WebEngine, but from XMLHttpRequest. qt-kiosk-browser currently loads a local file via QML XHR, and it works. This warning is about Qt disabling this feature by default in the future. This means that qt-kiosk-browser will need to explicitly enable this feature or find an alternative, or else users will need to be informed about setting QML_XHR_ALLOW_FILE_READ=1.

This issue is meant to track the progress on this concern.

@otavio
Copy link
Member

otavio commented Oct 7, 2021

You can set the variable it seems. Do you mind to cook a PR adding the QML_XHR_ALLOW_FILE_READ=1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants