Sailfish Webview
API DocumentationAuthPopupInterface QML Type
A component which defines the interface for the auth popup More...
Import Statement: | import Sailfish.WebView.Popups 1.0 |
Inherits: |
Properties
- hostname : string
- messageBundle : var
- passwordOnly : bool
- passwordPrefillValue : string
- passwordValue : string
- privateBrowsing : bool
- realm : string
- rememberMessageKey : var
- rememberPrefillValue : bool
- rememberValue : bool
- rememberVisible : bool
- usernameAutofocus : bool
- usernamePrefillValue : string
- usernameValue : string
- usernameVisible : bool
Detailed Description
The AuthPopupInterface
QML type is exposed through the Sailfish.WebView.Popups
QML import namespace.
Clients who use a WebView in their application may wish to customize the appearance or behavior of the authorization popup in their application.
To do so, their implementation must extend the AuthPopupInterface
, which itself extends the UserPromptInterface, and then they must tell the WebView to use their implementation via the popupProvider
property.
The key assigned to acceptText will always be "AcceptLogin" while cancelText will always be assigned the empty string.
See also UserPromptInterface and custompopups.
Property Documentation
The hostname of the site which is asking for credentials
A custom implementation should include this information in the message which it displays to the user, to allow the user to make an informed choice about which credentials to enter, or whether to accept or reject the prompt.
The gecko localization bundle of the message to display to the user
A custom implementation can use this information to tailor the message and details supplied to the user.
The value is either a string or an array. If it's an array then the first value will be the gecko localization key taken from the commonDialogs.properties file. The remaining items in the array are the parameter values to replace %1, %2, etc. in the string.
If the value is a string then it will be a gecko localization key without parameters.
You can search the Firefox Pontoon localization database for this file, followed by the appropriate key. The key can be one of the following values:
- EnterLoginForRealm3
- EnterLoginForProxy3
- EnterUserPasswordFor2
- EnterUserPasswordForCrossOrigin2
- EnterPasswordFor
Care must be taken as it's possible these values may change with future engine updates.
Will be true if no username is required from the user
A custom implementation should use the value of this property to determine whether or not to show an input field for a username as well as an input field for a password.
If either usernameVisible
is false
or passwordOnly
is true
then the username input field should not be shown to the user.
The password value which the user provided via the password field
A custom implementation should bind this property to the text
property of their password TextField
(or to the appropriate property of whatever input element is being used by the custom implementation to allow the user to provide password data).
It is an output property, whose value is read by the web view.
Will be true if the user is in private browsing mode
A custom implementation should use the value of this property to determine how to change the look-and-feel of the popup, to ensure that the user is reminded that the web view is currently in private browsing mode.
Also, if in private browsing mode, the custom implementation should not ask the user if they would like the web view to remember their credentials, and as such it should hide its "remember" toggle switch.
The realm within the site for which the credentials are being requested
A custom implementation should include this information in the message which it displays to the user, to allow the user to make an informed choice about which credentials to enter, or whether to accept or reject the prompt.
The gecko localization key of the message to display to the user for the "remember" toggle switch
A custom implementation can use this information to tailor the message shown alongside the "remember" toggle switch.
The value is either a string or an array. If it's an array then the first value will be the gecko localization key taken from the commonDialogs.properties file. The remaining items in the array are the parameter values to replace %1, %2, etc. in the string.
If the value is a string then it will be a gecko localization key without parameters.
You can search the Firefox Pontoon localization database for this file, followed by the appropriate key.
Currently there is only one value the key can take:
- rememberButton
Care must be taken as it's possible these values may change with future engine updates.
The value of the "remember" toggle switch
A custom implementation should bind this property to the checked
property of their ToggleSwitch
(or to the appropriate property of whatever input element is being used by the custom implementation to give the user an option to allow the web view to remember the credentials).
It is an output property, whose value is read by the web view.
Whether the "remember" toggle switch should be shown to the user
If the value of this property is true and if the value of the privateBrowsing
property is false, the custom implementation should provide a toggle switch which provides the user with an option to allow the web view to remember the credentials in future.
Whether the username input field should be given focus automatically when the popup is shown to the user
If the value of this property is true, the custom implementation should give the username input field focus immediately upon being shown, for example by binding the focus
property of the input field to the value of this property (but only if the username input field should be visible).
The username value which the user provided via the username field
A custom implementation should bind this property to the text
property of their username TextField
(or to the appropriate property of whatever input element is being used by the custom implementation to allow the user to provide username data).
It is an output property, whose value is read by the web view.
Whether the username input field should be visible to the user
A custom implementation should use the value of this property to determine whether or not to show an input field for a username as well as an input field for a password.
If either usernameVisible
is false
or passwordOnly
is true
then the username input field should not be shown to the user.