Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
if (existingScriptEl) existingScriptEl.remove();
const scriptEl = document.createElement('script');
scriptEl.setAttribute('type', 'text/javascript');
scriptEl.setAttribute('src', `${platform}/cordova.js`);
document.body.appendChild(scriptEl);
console.log(`Injected cordova.js of ${platform} platform.`);
};
if (!isWebview(navigator.userAgent)) {
injectCordovaScript('browser');
} else if (currentDevice.android()) {
injectCordovaScript('android');
} else if (currentDevice.ios()) {
injectCordovaScript('ios');
}