const logAction = async (logObject) => { agent = bowser.getParser(window.navigator.userAgent).parsedResult; logObject["browser_name"] = agent.browser.name; logObject["browser_version"] = agent.browser.version; logObject["operating_system"] = `${agent.os.name} ${agent.os.version}`; logObject["user_platform"] = agent.platform.type; const { href } = document.getElementById("log-action-url"); post(href, logObject); };