FedCm🧪
该域允许与FedCM对话框进行交互。
EN
This domain allows interacting with the FedCM dialog.
✅️️ Methods
🔨FedCm.clickDialogButton
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dialogId | ✔️ | string | |||
| dialogButton | ✔️ | DialogButton |
🔨FedCm.disable
🔨FedCm.dismissDialog
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dialogId | ✔️ | string | |||
| triggerCooldown | boolean |
🔨FedCm.enable
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| disableRejectionDelay | boolean | 允许调用者禁用通常会发生Promise拒绝延迟,如果这对正在测试的内容不重要。(https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in 的第4步) | ENAllows callers to disable the promise rejection delay that would normally happen, if this is unimportant to what's being tested. (step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in) |
🔨FedCm.openUrl
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dialogId | ✔️ | string | |||
| accountIndex | ✔️ | integer | |||
| accountUrlType | ✔️ | AccountUrlType |
🔨FedCm.resetCooldown
重置冷却时间(如果存在),以允许下一次FedCM调用显示对话框,即使用户最近刚刚关闭了一个对话框。
EN
Resets the cooldown time, if any, to allow the next FedCM call to show a dialog even if one was recently dismissed by the user.
🔨FedCm.selectAccount
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dialogId | ✔️ | string | |||
| accountIndex | ✔️ | integer |
✅️️ Events
👋FedCm.dialogClosed
当对话框被关闭时触发,无论是通过用户操作、JS 中止还是以下命令。
EN
Triggered when a dialog is closed, either by user action, JS abort, or a command below.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dialogId | ✔️ | string |
👋FedCm.dialogShown
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dialogId | ✔️ | string | |||
| dialogType | ✔️ | DialogType | |||
| accounts | ✔️ | array[Account] | |||
| title | ✔️ | string | 这些存在主要是为了让调用者能够验证RP上下文是否被恰当使用。 | ENThese exist primarily so that the caller can verify the RP context was used appropriately. | |
| subtitle | string |
✅️️ Types
📌FedCm.Account
对应 IdentityRequestAccount
EN
Corresponds to IdentityRequestAccount
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| accountId | ✔️ | string | |||
| ✔️ | string | ||||
| name | ✔️ | string | |||
| givenName | ✔️ | string | |||
| pictureUrl | ✔️ | string | |||
| idpConfigUrl | ✔️ | string | |||
| idpLoginUrl | ✔️ | string | |||
| loginState | ✔️ | LoginState | |||
| termsOfServiceUrl | string | 这两个仅在登录状态为注册时设置 | ENThese two are only set if the loginState is signUp | ||
| privacyPolicyUrl | string |
📌FedCm.AccountUrlType
每个账户拥有的URL
允许的值:TermsOfService、PrivacyPolicy
EN
The URLs that each account has
Allowed Values:
Allowed Values:
TermsOfService, PrivacyPolicy返回类型:string
📌FedCm.DialogButton
FedCM对话框上的按钮。
允许的值:ConfirmIdpLoginContinue、ErrorGotIt、ErrorMoreDetails
EN
The buttons on the FedCM dialog.
Allowed Values:
Allowed Values:
ConfirmIdpLoginContinue, ErrorGotIt, ErrorMoreDetails返回类型:string
📌FedCm.DialogType
FedCM对话框的类型。
允许的值:AccountChooser、AutoReauthn、ConfirmIdpLogin、Error
EN
The types of FedCM dialogs.
Allowed Values:
Allowed Values:
AccountChooser, AutoReauthn, ConfirmIdpLogin, Error返回类型:string
📌FedCm.LoginState
这是该账户的注册还是登录操作,即该账户之前是否曾用于登录此RP。
允许的值:SignIn、SignUp
EN
Whether this is a sign-up or sign-in action for this account, i.e. whether this account has ever been used to sign in to this RP before.
Allowed Values:
Allowed Values:
SignIn, SignUp返回类型:string