UNPKG

webcm

Version:

Demonstrative implementation of a web-based manager for utilising Managed Components

22 lines (21 loc) 634 B
"use strict"; ; ['pushState', 'replaceState'].forEach(changeState => { window.history[changeState] = (...args) => { History.prototype[changeState].apply(history, args); webcm .track('client', { event: 'historyChange', historyChange: [ { url: document.location.href, title: document.title, timestamp: new Date().getTime(), }, ], }) .then(webcm._processServerResponse); webcm.pageVars = {}; }; }); webcm.pageVars.__client.historyChange = true;