When a bug is a feature
After porting Falkon to Qt6 the WebIspector started working when JavaScript was disable. I and few people who help with Falkon development were of an opinion that this is a new feature of Qt6 and did not look too deep into it. What a nice feature to have.
It has a dark side as well, after porting to Qt6 the WebInspector settings were not saved into the profile. It was a bummer. I tried to investigate it but came with nothing, I looked at it from a wrong angle and wasted a lot of time. The solution was simple, initialize the QWebEngineView with an active QWebEngineProfile and the settings will be remembered.
And here we come a full circle. After fixing saving and loading of WebInspector preferences by making sure the View (well, the Page which the View is using) is using the correct profile, the feature that it runs even with disabled javascript was broken. So with this knowledge I could construct a workaround and always enable JavaScript for the WebInspector. Other option to consider is to create a new profile specificaly for WebInspector with specific configuration for it. Both solutions are good enough, each with its own pros and cons.
Using the current profile results in:
- There is only one profile on disk.
- Most of the user settings are still respected (local storage, history, cookiesm etc.).
- The required settings (JavaScript) has to be force enabled, and maybe more, thiws has to be found over time.
Using a new profile results in:
- Guard against using this profile in browser itself.
- Different configuration of web profile settings ( data location, images, etc.).
I went with same profile solution, I think it is simpler to bake few exceptions compared to doubling the configuration. The time will tell how good this solution is.