File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 6
6
*
7
7
* @see {@link https://developers.intercom.com/installing-intercom/docs/basic-javascript }
8
8
*/
9
- const initialize = ( appId : string ) => {
9
+ const initialize = ( appId : string , timeout = 0 ) => {
10
10
var w = window ;
11
11
var ic = w . Intercom ;
12
12
if ( typeof ic === 'function' ) {
@@ -23,12 +23,14 @@ const initialize = (appId: string) => {
23
23
} ;
24
24
w . Intercom = i ;
25
25
var l = function ( ) {
26
- var s = d . createElement ( 'script' ) ;
27
- s . type = 'text/javascript' ;
28
- s . async = true ;
29
- s . src = 'https://widget.intercom.io/widget/' + appId ;
30
- var x = d . getElementsByTagName ( 'script' ) [ 0 ] ;
31
- x . parentNode . insertBefore ( s , x ) ;
26
+ setTimeout ( function ( ) {
27
+ var s = d . createElement ( 'script' ) ;
28
+ s . type = 'text/javascript' ;
29
+ s . async = true ;
30
+ s . src = 'https://widget.intercom.io/widget/' + appId ;
31
+ var x = d . getElementsByTagName ( 'script' ) [ 0 ] ;
32
+ x . parentNode . insertBefore ( s , x ) ;
33
+ } , timeout )
32
34
} ;
33
35
if ( document . readyState === 'complete' ) {
34
36
l ( ) ;
You can’t perform that action at this time.
0 commit comments