diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-01-31 09:12:12 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-02-02 10:55:31 +0100 |
commit | c9852591cb8ccedfcdf0469db04be59671a912e9 (patch) | |
tree | c1eb88a1013758a25f62277278ed5df2ec96132d /examples/webenginequick/quicknanobrowser/doc/src | |
parent | 4f1bd9dbd41aaf6555604626f15a1923fd82267a (diff) | |
download | qtwebengine-c9852591cb8ccedfcdf0469db04be59671a912e9.tar.gz |
QuickNanoBrowser: Add feature permission request handling
Pick-to: 6.5
Change-Id: Ia0d8bffa419174234e78e1359871e0dfa36b1636
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/webenginequick/quicknanobrowser/doc/src')
-rw-r--r-- | examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc index b1910df95..ee94e0fd7 100644 --- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc +++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc @@ -91,6 +91,31 @@ \skipto Dialog { \printuntil /^\ {4}\}/ + \section1 Handling Feature Permission Requests + + We use the \c onFeaturePermissionRequested() signal handler to handle requests for + accessing a certain feature or device. The \c securityOrigin parameter identifies the + requester web site, and the \c feature parameter is the requested feature. We use these + to construct the message of the dialog: + + \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml + \skipto onFeaturePermissionRequested + \printuntil } + + We show a dialog where the user is asked to grant or deny access. The custom + \c questionForFeature() JavaScript function generates a human-readable question about + the request. + If users select \uicontrol Yes, we call the \l{WebEngineView::}{grantFeaturePermission()} + method with a third \c true parameter to grant the \c securityOrigin web site the permission + to access the \c feature. + If users select \uicontrol No, we call the same method but with the \c false parameter to + deny access: + + \skipto id: sslDialog + \skipto Dialog { + \printuntil /^\ {4}\}/ + + \section1 Entering and Leaving Fullscreen Mode We create a menu item for allowing fullscreen mode in a settings menu that we place on the tool |