|
@@ -16,14 +16,14 @@ let api = null;
|
16
|
16
|
*
|
17
|
17
|
* @returns {Promise<void>}
|
18
|
18
|
*/
|
19
|
|
-function _loadScript() {
|
|
19
|
+function _loadScript(options) {
|
20
|
20
|
if (browser.isReactNative()) {
|
21
|
21
|
return;
|
22
|
22
|
}
|
23
|
23
|
|
24
|
24
|
return new Promise(resolve => {
|
25
|
25
|
ScriptUtil.loadScript(
|
26
|
|
- CALLSTATS_SCRIPT_URL,
|
|
26
|
+ options.callStatsCustomScriptUrl || CALLSTATS_SCRIPT_URL,
|
27
|
27
|
/* async */ true,
|
28
|
28
|
/* prepend */ true,
|
29
|
29
|
/* relativeURL */ undefined,
|
|
@@ -85,7 +85,7 @@ export async function init(options) {
|
85
|
85
|
throw new Error('Callstats is disabled');
|
86
|
86
|
}
|
87
|
87
|
|
88
|
|
- await _loadScript();
|
|
88
|
+ await _loadScript(options);
|
89
|
89
|
// eslint-disable-next-line new-cap
|
90
|
90
|
api = new window.callstats();
|
91
|
91
|
|