Open URL with js window.open like window in user's default browser?
Unsolved
General and Desktop
-
I am trying to program with
QOAuth2AuthorizationCodeFlow
. From demos the authorization is performed byconnect(ptrToQOAuth, &QOAuth2AuthorizationCodeFlow::authorizeWithBrowser, &QDesktopServices::openUrl);
which will open user's default browser for the authorization page.
However, this has two problems:- I lose control of the opened webpage and cannot close it after authorization finished. JS code
window.close
in the redirected page cannot close the page in many browsers for security reason. - The page becomes a tab in the browser rather than a popup window.
One possibility is to open a widget with QWebView and close the window when from
QOAuth2AuthorizationCodeFlow
class when it receives relevant signals.But is there anyway that we can open a popup window with the authorization page, something like js
window.open
, with user's default browser rather than another Qt Widget, so that OAuth2 provider can use user's cookie. - I lose control of the opened webpage and cannot close it after authorization finished. JS code