webcm
Version:
Demonstrative implementation of a web-based manager for utilising Managed Components
21 lines (19 loc) • 536 B
JavaScript
;['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