Important: Please read the Qt Code of Conduct -

Change localStorage cache location at runtime with WebEngineProfile.storageName?

  • I'm building an application where it is necessary to pre-start WebEngine instances and then load JS into them dynamically. Because I want each app to have its own localStorage, and because I don't know which app I'm going to load into which WebEngine instance, I have a requirement that localStorage needs to be changed at runtime.

    It seems like it would be as easy as changing the storageName property on that WebEngineView's WebEngineProfile, but that seems to have no effect on localStorage. I've tried creating totally new WebEngineProfiles. I've tried it with every option, but no matter what, WebEngine continues to store localStorage in its original location on disk.

    Is this even possible, and if not, how would I work around this?

Log in to reply