Set cookie before loading url WebEngineView(qml)
How can I set cookie before loading a url on WebEngineView that is created in qml code, can I inherit from something like WebEngineViewItem to create my customized WebEngineView?
the WebEngineView widget has a page() method that return page and then I can get profile and then the cookieStore but I didn't find any way for qml code.
Seems this is OK,
QQuickWebEngineProfile* defaultProfile = QQuickWebEngineProfile::defaultProfile(); QWebEngineCookieStore *cookieStore = defaultProfile->cookieStore(); QNetworkCookie cookie; cookie.setDomain("domain.com"); cookie.setName("devmode"); cookie.setValue("true"); cookieStore->setCookie(cookie);
You can also pass the profile property of the WebEngineView from Qml to C++ and do same.
There is no page method for Qml WebEngineView.