OSSystems / qt-kiosk-browser

Provides a simple but highly configurable browser for use on Kiosk devices
GNU General Public License v3.0
16 stars 13 forks source link

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

Open vivien opened 2 years ago

vivien commented 2 years ago

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 commented 2 years ago

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

vivien commented 2 years ago

@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 commented 2 years ago

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