diff options
Diffstat (limited to 'examples/webenginequick')
-rw-r--r-- | examples/webenginequick/quicknanobrowser/BrowserWindow.qml | 5 | ||||
-rw-r--r-- | examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml index 3b911262b..e2cb71fb3 100644 --- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml +++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml @@ -563,6 +563,11 @@ ApplicationWindow { settings.imageAnimationPolicy: appSettings.imageAnimationPolicy onCertificateError: function(error) { + if (!error.isMainFrame) { + error.rejectCertificate(); + return; + } + error.defer(); sslDialog.enqueue(error); } diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc index 1dc209c2e..1e00402ff 100644 --- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc +++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc @@ -75,13 +75,16 @@ \section1 Handling Certificate Errors - If the certificate of the site being loaded triggers a certificate error, we call the - \l{WebEngineCertificateError::}{defer()} QML method to pause the URL request and wait for user - input: + In case of a certificate error, we check whether it came from the main frame, or from a + resource inside the page. Resource errors automatically trigger a certificate rejection, + since a user won't have enough context to make a decision. + For all other cases, we call the \l{WebEngineCertificateError::}{defer()} QML method to pause + the URL request and wait for user input: \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml \skipto onCertificateError \printuntil } + \printuntil } We use the Dialog type to prompt users to continue or cancel the loading of the web page. If users select \uicontrol Yes, we call the |