Metoda PickerBuilder.setOrigin
Określa pochodzenie okna selektora. Jeśli aplikacja działa w ramce iframe, ustawienie pochodzenia powinno być równe window.location.protocol + '//' + window.location.host najwyższej strony.
Podpis
setOrigin(origin: string): PickerBuilder;
Szczegóły
Opcjonalnie |
Nie |
Finał |
Nie |
Chroniony |
Nie |
Statyczny |
Nie |
Parametry
Nazwa |
Typ |
Opcjonalnie |
Opis |
origin |
string |
Nie |
|
Zwroty
PickerBuilder
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-11-07 UTC.
[null,null,["Ostatnia aktualizacja: 2024-11-07 UTC."],[[["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"]]