@firebase/auth 1.13.10 → 1.13.11-20261116185243
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -13
- package/dist/browser-cjs/{index-D_utMrqy.js → index-CpWQky3K.js} +52 -21
- package/dist/browser-cjs/index-CpWQky3K.js.map +1 -0
- package/dist/browser-cjs/index.js +1 -1
- package/dist/browser-cjs/internal.js +1 -1
- package/dist/{cordova/test/integration/webdriver/util/js_load_condition.d.ts → browser-cjs/src/platform_browser/load_js_browser.d.ts} +7 -8
- package/dist/browser-cjs/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/browser-cjs/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/browser-cjs/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +53 -22
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-7H-mFAlV.js → popup_redirect-CGTSpghz.js} +2 -2
- package/dist/cordova/{popup_redirect-7H-mFAlV.js.map → popup_redirect-CGTSpghz.js.map} +1 -1
- package/dist/{esm/test/integration/webdriver/util/js_load_condition.d.ts → cordova/src/platform_browser/load_js_browser.d.ts} +7 -8
- package/dist/cordova/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/cordova/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/cordova/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/esm/{index-NmqYMaDt.js → index-B83XeA2v.js} +53 -22
- package/dist/esm/index-B83XeA2v.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal.js +2 -2
- package/dist/{browser-cjs/test/integration/webdriver/util/js_load_condition.d.ts → esm/src/platform_browser/load_js_browser.d.ts} +7 -8
- package/dist/esm/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/esm/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/esm/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/index.webworker.js +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/platform_browser/load_js_browser.d.ts +24 -0
- package/dist/node/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/node/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/node/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/node/{totp-c24YsbkT.js → totp-CkbqXM8U.js} +2 -2
- package/dist/node/{totp-c24YsbkT.js.map → totp-CkbqXM8U.js.map} +1 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/{test/integration/webdriver/util/js_load_condition.d.ts → src/platform_browser/load_js_browser.d.ts} +7 -8
- package/dist/node-esm/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/node-esm/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/node-esm/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/node-esm/{totp-DWW-ace_.js → totp-B65jY57a.js} +2 -2
- package/dist/node-esm/{totp-DWW-ace_.js.map → totp-B65jY57a.js.map} +1 -1
- package/dist/rn/{index-UkwZ-hC_.js → index-BI5SQ2TI.js} +2 -2
- package/dist/rn/{index-UkwZ-hC_.js.map → index-BI5SQ2TI.js.map} +1 -1
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +51 -20
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/platform_browser/load_js_browser.d.ts +24 -0
- package/dist/rn/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/rn/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/rn/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/src/platform_browser/load_js_browser.d.ts +24 -0
- package/dist/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +51 -20
- package/dist/web-extension-cjs/internal.js.map +1 -1
- package/dist/web-extension-cjs/{register-B6mm-2Ol.js → register-DRXqQWJe.js} +2 -2
- package/dist/web-extension-cjs/{register-B6mm-2Ol.js.map → register-DRXqQWJe.js.map} +1 -1
- package/dist/web-extension-cjs/src/platform_browser/load_js_browser.d.ts +24 -0
- package/dist/web-extension-cjs/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/web-extension-cjs/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/web-extension-cjs/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/dist/web-extension-esm/index.js +2 -2
- package/dist/web-extension-esm/internal.js +53 -22
- package/dist/web-extension-esm/internal.js.map +1 -1
- package/dist/web-extension-esm/{register-Cv6DpA4G.js → register-CWk4FQGj.js} +2 -2
- package/dist/web-extension-esm/{register-Cv6DpA4G.js.map → register-CWk4FQGj.js.map} +1 -1
- package/dist/web-extension-esm/src/platform_browser/load_js_browser.d.ts +24 -0
- package/dist/web-extension-esm/test/integration/webdriver/util/auth_driver.d.ts +9 -5
- package/dist/web-extension-esm/test/integration/webdriver/util/idp_page.d.ts +2 -2
- package/dist/web-extension-esm/test/integration/webdriver/util/ui_page.d.ts +2 -2
- package/package.json +3 -6
- package/dist/browser-cjs/index-D_utMrqy.js.map +0 -1
- package/dist/esm/index-NmqYMaDt.js.map +0 -1
- package/dist/node/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
- package/dist/rn/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
- package/dist/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
- package/dist/web-extension-cjs/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
- package/dist/web-extension-esm/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Loads an external script by inserting a script tag into the page. The script
|
|
19
|
+
* URL is set through the Firebase Trusted Types policy when Trusted Types are
|
|
20
|
+
* supported, so that this works on pages that enforce Trusted Types.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare function _loadJSInBrowser(url: string): Promise<Event>;
|
|
@@ -14,16 +14,20 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Auth, User, Persistence } from '@firebase/auth';
|
|
18
|
-
import {
|
|
17
|
+
import type { Auth, User, Persistence } from '@firebase/auth';
|
|
18
|
+
import type { Browser, BrowserContext, Page } from 'playwright';
|
|
19
19
|
export declare const START_FUNCTION = "startAuth";
|
|
20
|
-
/** Helper wrapper around the
|
|
20
|
+
/** Helper wrapper around the Playwright Page and BrowserContext objects */
|
|
21
21
|
export declare class AuthDriver {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
browser: Browser;
|
|
23
|
+
context: BrowserContext;
|
|
24
|
+
page: Page;
|
|
25
|
+
start(browserName: string): Promise<void>;
|
|
24
26
|
stop(): Promise<void>;
|
|
25
27
|
call<T>(fn: string, ...args: unknown[]): Promise<T>;
|
|
26
28
|
callNoWait(fn: string, ...args: unknown[]): Promise<void>;
|
|
29
|
+
waitForGlobal(globalValue: string): Promise<void>;
|
|
30
|
+
wait(condition: () => Promise<boolean> | boolean, timeoutMs?: number): Promise<void>;
|
|
27
31
|
getAuthSnapshot(): Promise<Auth>;
|
|
28
32
|
getUserSnapshot(): Promise<User>;
|
|
29
33
|
reset(): Promise<void>;
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import type { AuthDriver } from './auth_driver';
|
|
18
18
|
export declare class IdPPage {
|
|
19
19
|
private readonly driver;
|
|
20
20
|
static PAGE_TITLE: string;
|
|
21
|
-
constructor(driver:
|
|
21
|
+
constructor(driver: AuthDriver);
|
|
22
22
|
pageLoad(): Promise<void>;
|
|
23
23
|
clickAddAccount(): Promise<void>;
|
|
24
24
|
clickSignIn(): Promise<void>;
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import type { AuthDriver } from './auth_driver';
|
|
18
18
|
export declare class UiPage {
|
|
19
19
|
private readonly driver;
|
|
20
|
-
constructor(driver:
|
|
20
|
+
constructor(driver: AuthDriver);
|
|
21
21
|
clickGuestSignIn(): Promise<void>;
|
|
22
22
|
clickGoogleSignIn(): Promise<void>;
|
|
23
23
|
clickPhoneSignIn(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerAuth, i as initializeAuth, c as connectAuthEmulator, a as indexedDBLocalPersistence } from './register-
|
|
2
|
-
export { A as ActionCodeURL, b as AuthCredential, d as AuthErrorCodes, E as EmailAuthCredential, e as EmailAuthProvider, F as FacebookAuthProvider, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, P as PhoneAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, h as TotpSecret, j as TwitterAuthProvider, k as applyActionCode, l as beforeAuthStateChanged, m as checkActionCode, n as confirmPasswordReset, o as createUserWithEmailAndPassword, p as debugErrorMap, q as deleteUser, s as fetchSignInMethodsForEmail, t as getAdditionalUserInfo, u as getIdToken, v as getIdTokenResult, w as getMultiFactorResolver, x as inMemoryPersistence, y as initializeRecaptchaConfig, z as isSignInWithEmailLink, B as linkWithCredential, C as multiFactor, D as onAuthStateChanged, H as onIdTokenChanged, I as parseActionCodeURL, J as prodErrorMap, K as reauthenticateWithCredential, L as reload, M as revokeAccessToken, N as sendEmailVerification, Q as sendPasswordResetEmail, R as sendSignInLinkToEmail, U as setPersistence, V as signInAnonymously, W as signInWithCredential, X as signInWithCustomToken, Y as signInWithEmailAndPassword, Z as signInWithEmailLink, _ as signOut, $ as unlink, a0 as updateCurrentUser, a1 as updateEmail, a2 as updatePassword, a3 as updateProfile, a4 as useDeviceLanguage, a5 as validatePassword, a6 as verifyBeforeUpdateEmail, a7 as verifyPasswordResetCode } from './register-
|
|
1
|
+
import { r as registerAuth, i as initializeAuth, c as connectAuthEmulator, a as indexedDBLocalPersistence } from './register-CWk4FQGj.js';
|
|
2
|
+
export { A as ActionCodeURL, b as AuthCredential, d as AuthErrorCodes, E as EmailAuthCredential, e as EmailAuthProvider, F as FacebookAuthProvider, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, P as PhoneAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, h as TotpSecret, j as TwitterAuthProvider, k as applyActionCode, l as beforeAuthStateChanged, m as checkActionCode, n as confirmPasswordReset, o as createUserWithEmailAndPassword, p as debugErrorMap, q as deleteUser, s as fetchSignInMethodsForEmail, t as getAdditionalUserInfo, u as getIdToken, v as getIdTokenResult, w as getMultiFactorResolver, x as inMemoryPersistence, y as initializeRecaptchaConfig, z as isSignInWithEmailLink, B as linkWithCredential, C as multiFactor, D as onAuthStateChanged, H as onIdTokenChanged, I as parseActionCodeURL, J as prodErrorMap, K as reauthenticateWithCredential, L as reload, M as revokeAccessToken, N as sendEmailVerification, Q as sendPasswordResetEmail, R as sendSignInLinkToEmail, U as setPersistence, V as signInAnonymously, W as signInWithCredential, X as signInWithCustomToken, Y as signInWithEmailAndPassword, Z as signInWithEmailLink, _ as signOut, $ as unlink, a0 as updateCurrentUser, a1 as updateEmail, a2 as updatePassword, a3 as updateProfile, a4 as useDeviceLanguage, a5 as validatePassword, a6 as verifyBeforeUpdateEmail, a7 as verifyPasswordResetCode } from './register-CWk4FQGj.js';
|
|
3
3
|
import { _getProvider, getApp } from '@firebase/app';
|
|
4
4
|
import { getDefaultEmulatorHost } from '@firebase/util';
|
|
5
5
|
import '@firebase/component';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a8 as STORAGE_AVAILABLE_KEY, a9 as _isMobileBrowser, aa as _isIE10, ab as Delay, ac as MockReCaptcha, ad as _window, ae as _assert, af as isV2, ag as _createError, ah as _recaptchaV2ScriptUrl, ai as _loadJS, aj as _generateCallbackName, ak as _castAuth, al as _isHttpOrHttps, am as _isWorker, an as getRecaptchaParams, ao as _assertLinkedStatus, B as linkWithCredential, ap as _serverAppCurrentUserOperationNotSupportedError, K as reauthenticateWithCredential, W as signInWithCredential, aq as _link$1, ar as _initializeRecaptchaConfig, as as FAKE_TOKEN, at as startEnrollPhoneMfa, au as handleRecaptchaFlow, av as startSignInPhoneMfa, aw as sendPhoneVerificationCode, P as PhoneAuthCredential, ax as _getInstance, ay as _reauthenticate, az as _signInWithCredential, b as AuthCredential, aA as signInWithIdp, aB as _fail, aC as debugAssert, aD as _assertInstanceOf, aE as _generateEventId, aF as FederatedAuthProvider, aG as _persistenceKeyName, aH as _performApiRequest, aI as _getCurrentUrl, aJ as _gapiScriptUrl, aK as _emulatorUrl, aL as _isChromeIOS, aM as _isFirefox, aN as _isIOSStandalone, aO as BaseOAuthProvider, aP as _setWindowLocation, aQ as _isSafari, aR as _isIOS, aS as MultiFactorAssertionImpl, aT as finalizeEnrollPhoneMfa, aU as finalizeSignInPhoneMfa, r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, l as beforeAuthStateChanged, H as onIdTokenChanged, c as connectAuthEmulator, aV as _setExternalJSProvider, aW as _isAndroid, aX as _isIOS7Or8 } from './register-
|
|
2
|
-
export { A as ActionCodeURL, d as AuthErrorCodes, aY as AuthImpl, E as EmailAuthCredential, e as EmailAuthProvider, F as FacebookAuthProvider, aZ as FetchProvider, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, a_ as SAMLAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, h as TotpSecret, j as TwitterAuthProvider, a$ as UserImpl, b0 as _getClientVersion, k as applyActionCode, m as checkActionCode, n as confirmPasswordReset, o as createUserWithEmailAndPassword, p as debugErrorMap, q as deleteUser, s as fetchSignInMethodsForEmail, t as getAdditionalUserInfo, u as getIdToken, v as getIdTokenResult, w as getMultiFactorResolver, x as inMemoryPersistence, y as initializeRecaptchaConfig, z as isSignInWithEmailLink, C as multiFactor, D as onAuthStateChanged, I as parseActionCodeURL, J as prodErrorMap, L as reload, M as revokeAccessToken, N as sendEmailVerification, Q as sendPasswordResetEmail, R as sendSignInLinkToEmail, U as setPersistence, V as signInAnonymously, X as signInWithCustomToken, Y as signInWithEmailAndPassword, Z as signInWithEmailLink, _ as signOut, $ as unlink, a0 as updateCurrentUser, a1 as updateEmail, a2 as updatePassword, a3 as updateProfile, a4 as useDeviceLanguage, a5 as validatePassword, a6 as verifyBeforeUpdateEmail, a7 as verifyPasswordResetCode } from './register-
|
|
1
|
+
import { a8 as STORAGE_AVAILABLE_KEY, a9 as _isMobileBrowser, aa as _isIE10, ab as Delay, ac as MockReCaptcha, ad as _window, ae as _assert, af as isV2, ag as _createError, ah as _recaptchaV2ScriptUrl, ai as _loadJS, aj as _generateCallbackName, ak as _castAuth, al as _isHttpOrHttps, am as _isWorker, an as getRecaptchaParams, ao as _assertLinkedStatus, B as linkWithCredential, ap as _serverAppCurrentUserOperationNotSupportedError, K as reauthenticateWithCredential, W as signInWithCredential, aq as _link$1, ar as _initializeRecaptchaConfig, as as FAKE_TOKEN, at as startEnrollPhoneMfa, au as handleRecaptchaFlow, av as startSignInPhoneMfa, aw as sendPhoneVerificationCode, P as PhoneAuthCredential, ax as _getInstance, ay as _reauthenticate, az as _signInWithCredential, b as AuthCredential, aA as signInWithIdp, aB as _fail, aC as debugAssert, aD as _assertInstanceOf, aE as _generateEventId, aF as FederatedAuthProvider, aG as _persistenceKeyName, aH as _performApiRequest, aI as _getCurrentUrl, aJ as _gapiScriptUrl, aK as _emulatorUrl, aL as _isChromeIOS, aM as _isFirefox, aN as _isIOSStandalone, aO as BaseOAuthProvider, aP as _setWindowLocation, aQ as _isSafari, aR as _isIOS, aS as MultiFactorAssertionImpl, aT as finalizeEnrollPhoneMfa, aU as finalizeSignInPhoneMfa, r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, l as beforeAuthStateChanged, H as onIdTokenChanged, c as connectAuthEmulator, aV as _setExternalJSProvider, aW as _isAndroid, aX as _isIOS7Or8 } from './register-CWk4FQGj.js';
|
|
2
|
+
export { A as ActionCodeURL, d as AuthErrorCodes, aY as AuthImpl, E as EmailAuthCredential, e as EmailAuthProvider, F as FacebookAuthProvider, aZ as FetchProvider, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, a_ as SAMLAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, h as TotpSecret, j as TwitterAuthProvider, a$ as UserImpl, b0 as _getClientVersion, k as applyActionCode, m as checkActionCode, n as confirmPasswordReset, o as createUserWithEmailAndPassword, p as debugErrorMap, q as deleteUser, s as fetchSignInMethodsForEmail, t as getAdditionalUserInfo, u as getIdToken, v as getIdTokenResult, w as getMultiFactorResolver, x as inMemoryPersistence, y as initializeRecaptchaConfig, z as isSignInWithEmailLink, C as multiFactor, D as onAuthStateChanged, I as parseActionCodeURL, J as prodErrorMap, L as reload, M as revokeAccessToken, N as sendEmailVerification, Q as sendPasswordResetEmail, R as sendSignInLinkToEmail, U as setPersistence, V as signInAnonymously, X as signInWithCustomToken, Y as signInWithEmailAndPassword, Z as signInWithEmailLink, _ as signOut, $ as unlink, a0 as updateCurrentUser, a1 as updateEmail, a2 as updatePassword, a3 as updateProfile, a4 as useDeviceLanguage, a5 as validatePassword, a6 as verifyBeforeUpdateEmail, a7 as verifyPasswordResetCode } from './register-CWk4FQGj.js';
|
|
3
3
|
import { querystring, getModularInstance, getUA, isEmpty, getExperimentalSetting, getDefaultEmulatorHost, querystringDecode } from '@firebase/util';
|
|
4
|
-
import { _isFirebaseServerApp, SDK_VERSION, _getProvider, getApp } from '@firebase/app';
|
|
4
|
+
import { _isFirebaseServerApp, SDK_VERSION, _setTrustedScriptSrc, _getProvider, getApp } from '@firebase/app';
|
|
5
5
|
import '@firebase/component';
|
|
6
6
|
import '@firebase/logger';
|
|
7
7
|
|
|
@@ -2810,6 +2810,55 @@ class PhoneMultiFactorGenerator {
|
|
|
2810
2810
|
*/
|
|
2811
2811
|
PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
|
|
2812
2812
|
|
|
2813
|
+
/**
|
|
2814
|
+
* @license
|
|
2815
|
+
* Copyright 2026 Google LLC
|
|
2816
|
+
*
|
|
2817
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2818
|
+
* you may not use this file except in compliance with the License.
|
|
2819
|
+
* You may obtain a copy of the License at
|
|
2820
|
+
*
|
|
2821
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2822
|
+
*
|
|
2823
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2824
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2825
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2826
|
+
* See the License for the specific language governing permissions and
|
|
2827
|
+
* limitations under the License.
|
|
2828
|
+
*/
|
|
2829
|
+
function getScriptParentElement() {
|
|
2830
|
+
return document.getElementsByTagName('head')?.[0] ?? document;
|
|
2831
|
+
}
|
|
2832
|
+
/**
|
|
2833
|
+
* Loads an external script by inserting a script tag into the page. The script
|
|
2834
|
+
* URL is set through the Firebase Trusted Types policy when Trusted Types are
|
|
2835
|
+
* supported, so that this works on pages that enforce Trusted Types.
|
|
2836
|
+
*
|
|
2837
|
+
* @internal
|
|
2838
|
+
*/
|
|
2839
|
+
function _loadJSInBrowser(url) {
|
|
2840
|
+
// TODO: consider adding timeout support & cancellation
|
|
2841
|
+
return new Promise((resolve, reject) => {
|
|
2842
|
+
const el = document.createElement('script');
|
|
2843
|
+
try {
|
|
2844
|
+
_setTrustedScriptSrc(el, url);
|
|
2845
|
+
}
|
|
2846
|
+
catch (e) {
|
|
2847
|
+
reject(e);
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2850
|
+
el.onload = resolve;
|
|
2851
|
+
el.onerror = e => {
|
|
2852
|
+
const error = _createError("internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
2853
|
+
error.customData = e;
|
|
2854
|
+
reject(error);
|
|
2855
|
+
};
|
|
2856
|
+
el.type = 'text/javascript';
|
|
2857
|
+
el.charset = 'UTF-8';
|
|
2858
|
+
getScriptParentElement().appendChild(el);
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2813
2862
|
/**
|
|
2814
2863
|
* @license
|
|
2815
2864
|
* Copyright 2021 Google LLC
|
|
@@ -2891,26 +2940,8 @@ function getAuth(app = getApp()) {
|
|
|
2891
2940
|
}
|
|
2892
2941
|
return auth;
|
|
2893
2942
|
}
|
|
2894
|
-
function getScriptParentElement() {
|
|
2895
|
-
return document.getElementsByTagName('head')?.[0] ?? document;
|
|
2896
|
-
}
|
|
2897
2943
|
_setExternalJSProvider({
|
|
2898
|
-
loadJS
|
|
2899
|
-
// TODO: consider adding timeout support & cancellation
|
|
2900
|
-
return new Promise((resolve, reject) => {
|
|
2901
|
-
const el = document.createElement('script');
|
|
2902
|
-
el.setAttribute('src', url);
|
|
2903
|
-
el.onload = resolve;
|
|
2904
|
-
el.onerror = e => {
|
|
2905
|
-
const error = _createError("internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
2906
|
-
error.customData = e;
|
|
2907
|
-
reject(error);
|
|
2908
|
-
};
|
|
2909
|
-
el.type = 'text/javascript';
|
|
2910
|
-
el.charset = 'UTF-8';
|
|
2911
|
-
getScriptParentElement().appendChild(el);
|
|
2912
|
-
});
|
|
2913
|
-
},
|
|
2944
|
+
loadJS: _loadJSInBrowser,
|
|
2914
2945
|
gapiScript: 'https://apis.google.com/js/api.js',
|
|
2915
2946
|
recaptchaV2Script: 'https://www.google.com/recaptcha/api.js',
|
|
2916
2947
|
recaptchaEnterpriseScript: 'https://www.google.com/recaptcha/enterprise.js?render='
|