We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7187b5a commit f5378b3Copy full SHA for f5378b3
src/web.ts
@@ -22,11 +22,20 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin {
22
}
23
24
loadScript() {
25
- var head = document.getElementsByTagName('head')[0];
26
- var script = document.createElement('script');
+ const scriptId = 'gapi'
+ const scriptEl = document?.getElementById(scriptId)
27
+
28
+ if (scriptEl) {
29
+ return
30
+ }
31
32
+ var head = document.getElementsByTagName('head')[0]
33
+ var script = document.createElement('script')
34
35
script.type = 'text/javascript';
36
script.defer = true;
37
script.async = true;
38
+ script.id = scriptId
39
script.onload = this.platformJsLoaded;
40
script.src = 'https://apis.google.com/js/platform.js';
41
head.appendChild(script);
0 commit comments