qt-kiosk-browser icon indicating copy to clipboard operation
qt-kiosk-browser copied to clipboard

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

Open vivien opened this issue 3 years ago • 3 comments

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.

vivien avatar Oct 06 '21 21:10 vivien

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

otavio avatar Oct 07 '21 13:10 otavio

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

vivien avatar Oct 07 '21 18:10 vivien

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

otavio avatar Oct 07 '21 18:10 otavio