方法 PickerBuilder.setOrigin
设置选择器对话框的来源。如果您的应用在 iframe 中运行,则来源应设置为最顶层网页的 window.location.protocol + '//' + window.location.host。
签名
setOrigin(origin: string): PickerBuilder;
详细信息
参数
名称 |
类型 |
可选 |
说明 |
origin |
string |
否 |
|
返回
PickerBuilder
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-07。
[null,null,["最后更新时间 (UTC):2024-11-07。"],[[["Sets the origin of the picker dialog, crucial for applications running in iframes to ensure proper functionality by specifying the top-most page's origin."],["The `setOrigin` method requires a single, mandatory parameter: `origin`, which is a string representing the desired origin."],["This method is not optional, final, protected, or static, offering flexibility in its implementation."],["Using this method returns a `PickerBuilder` instance, enabling further configuration of the picker dialog."]]],["The `setOrigin` function configures the origin of a picker dialog. It requires a string parameter, `origin`, which should be the protocol and host of the top-most page (e.g., `window.location.protocol + '//' + window.location.host`) when the application runs within an iframe. This function, part of the `PickerBuilder`, is not optional, final, protected, or static, and returns a `PickerBuilder` object.\n"]]