[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-22。"],[[["\u003cp\u003eThe Intermediate Iframe Support JavaScript API allows you to interact with and control the intermediate iframe used in the One Tap user experience flow.\u003c/p\u003e\n"],["\u003cp\u003eYou can verify the parent origin, notify the parent of events like flow completion or cancellation, and resize the iframe using this API.\u003c/p\u003e\n"],["\u003cp\u003eInclude the provided script tag in your HTML to load the library, and then utilize the listed methods to manage the iframe behavior.\u003c/p\u003e\n"],["\u003cp\u003eDetailed method descriptions, parameters, and usage examples are provided to facilitate seamless integration.\u003c/p\u003e\n"],["\u003cp\u003eThis API is essential for customizing the One Tap integration and ensuring a smooth user experience within your website or application.\u003c/p\u003e\n"]]],[],null,["# Intermediate iframe Support JavaScript API reference\n\nThis reference page describes the Intermediate iframe Support JavaScript API,\nused by One Tap to manipulate the intermediate iframe in subsequent UX.\n\nSee the [Integrate One Tap using an Iframe](/identity/gsi/web/amp/intermediate-iframe) guide to learn how to use\nintermediate iframes.\n\nThe following table lists all available methods and their behaviors.\n\n| Methods ||\n|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [verifyParentOrigin](/identity/gsi/web/amp/intermediate-support-reference#verifyParentOrigin) | performs the parent origin verification |\n| [notifyParentClose](/identity/gsi/web/amp/intermediate-support-reference#notifyParentClose) | notifies the parent frame the One Tap UX flow is skipped |\n| [notifyParentDone](/identity/gsi/web/amp/intermediate-support-reference#notifyParentDone) | notifies the parent frame the One Tap UX flow is done |\n| [notifyParentResize](/identity/gsi/web/amp/intermediate-support-reference#notifyParentResize) | notifies the parent frame to resize the intermediate iframe |\n| [notifyParentTapOutsideMode](/identity/gsi/web/amp/intermediate-support-reference#notifyParentTapOutsideMode) | notifies the parent frame whether to cancel the intermediate iframe when the user clicks outside the intermediate iframe |\n\n\u003cbr /\u003e\n\nLoad the Intermediate Iframe Support JavaScript Library\n-------------------------------------------------------\n\nPlace the following code snippet into any HTML pages where you want to load the\nintermediate iframe: \n\n```text\n\u003cscript src=\"https://accounts.google.com/gsi/intermediatesupport\"\u003e\u003c/script\u003e\n```\n\nMethod: google.accounts.id.intermediate.verifyParentOrigin\n----------------------------------------------------------\n\nThe `google.accounts.id.intermediate.verifyParentOrigin` method performs the\nparent origin verification. See the following code example of the method: \n\n google.accounts.id.intermediate.verifyParentOrigin(\n origins, verifiedCallback, verificationFailedCallback)\n\nThe following code example shows how to show UI only after the parent origin is\nverified: \n\n \u003cscript\u003e\n window.onload = () =\u003e {\n google.accounts.id.intermediate.verifyParentOrigin(\n \"https://example.com\", showUI, showError);\n };\n \u003c/script\u003e\n\nThe following table lists the parameters:\n\n| Parameter ||\n|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [origins](/identity/gsi/web/amp/intermediate-support-reference#origins) | The origins that are allowed to embed the intermediate iframe. |\n| [verifiedCallback](/identity/gsi/web/amp/intermediate-support-reference#verifiedCallback) | The JavaScript callback method triggered when the current parent origin is allowed to embed the intermediate iframe. |\n| [verificationFailedCallback](/identity/gsi/web/amp/intermediate-support-reference#verificationFailedCallback) | The JavaScript callback method triggered when the current parent origin is not allowed to embed the intermediate iframe. |\n\n### origins\n\nThe origins that are allowed to embed the intermediate iframe. See the following\ntable for further information:\n\n| Type | Required | Example |\n|----------------------------------|----------|------------------------------------------------|\n| string, string array or function | Optional | `allowed_parent_origin: \"https://example.com\"` |\n\nThe following table lists the supported value types and their descriptions.\n\n| Value Types |||\n|----------------|--------------------------|------------------------------------------------------|\n| `string` | A single domain URI. | \"https://example.com\" |\n| `string array` | An array of domain URIs. | \"https://news.example.com,https://local.example.com\" |\n\n| **Note:** A string with comma-separated URIs is invalid. Use a JavaScript Array object instead.\n\n### verifiedCallback\n\nThis field is a JavaScript callback method triggered when the current parent\norigin is allowed to embed the intermediate iframe.\n\n### verificationFailedCallback\n\nThis field is a JavaScript callback method triggered when the current parent\norigin is not allowed to embed the intermediate iframe.\n| **Warning:** if the content page doesn't respond to the domain verification request, the verification process waits forever. In this case, neither `verifiedCallback` nor `verificationFailedCallback` is invoked.\n\nMethod: google.accounts.id.intermediate.notifyParentClose\n---------------------------------------------------------\n\nThe `google.accounts.id.intermediate.notifyParentClose` method notifies the\nparent frame to close the intermediate iframe when the One Tap UX flow is\nskipped. See the following code example of the method: \n\n google.accounts.id.intermediate.notifyParentClose()\n\nMethod: google.accounts.id.intermediate.notifyParentDone\n--------------------------------------------------------\n\nThe `google.accounts.id.intermediate.notifyParentClose` method notifies the\nparent frame to close the intermediate iframe and refresh the login status. See\nthe following code example of the method: \n\n google.accounts.id.intermediate.notifyParentDone()\n\nMethod: google.accounts.id.intermediate.notifyParentResize\n----------------------------------------------------------\n\nThe `google.accounts.id.intermediate.notifyParentResize` method notifies the\nparent frame to resize the intermediate iframe. See the following code example\nof the method: \n\n google.accounts.id.intermediate.notifyParentResize(height)\n\n| **Note:** You cannot change the width of the intermediate iframe.\n\n### height\n\nThe new height in pixel. This is a required field. The value must be a\nnon-negative number.\n\nIf the height parameter is greater than 0, the intermediate iframe is set to\nthe new height. If the height parameter is 0, the intermediate iframe becomes\ninvisible. A hidden iframe is not closed. It can be shown later by another\nresize method call.\n\nMethod: google.accounts.id.intermediate.notifyParentTapOutsideMode\n------------------------------------------------------------------\n\nThe `google.accounts.id.intermediate.notifyParentTapOutsideMode` method notifies\nthe parent frame whether to cancel the intermediate iframe when the user clicks\noutside the intermediate iframe. See the following code example of the method: \n\n google.accounts.id.intermediate.notifyParentTapOutsideMode(cancel)\n\n### cancel\n\nThis required boolean value indicates whether to cancel the intermediate iframe\nwhen the user clicks outside the intermediate iframe."]]