common.ui.js 650 B

123456789101112
  1. window.ajaxInstallEvent = function(location = '', entrance = '')
  2. {
  3. $.getLib(config.webRoot + 'js/fingerprint/fingerprint.js', {root: false}, async function()
  4. {
  5. const agent = typeof(FingerprintJS) !== 'undefined' ? await FingerprintJS.load() : '';
  6. let fingerprint = agent ? await agent.get() : '';
  7. fingerprint = fingerprint ? fingerprint.visitorId : '';
  8. let eventUrl = $.createLink('misc', 'installEvent');
  9. if(entrance === 'index') eventUrl = eventUrl.replace('install.php', 'index.php');
  10. $.ajax({url: eventUrl, type: "post", data: {fingerprint, location}, timeout: 2000});
  11. });
  12. }