Updated url.
This commit is contained in:
parent
52b567cc5e
commit
56a8098234
@ -26,9 +26,20 @@ class Metriki {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit(data){
|
emit(data){
|
||||||
this.ws.send(JSON.stringify(data))
|
const me = this
|
||||||
|
try{
|
||||||
|
this.ws.send(JSON.stringify(data))
|
||||||
|
}catch(e){
|
||||||
|
this.isConnected = false
|
||||||
|
setTimeout(() => {
|
||||||
|
me.emitVisit()
|
||||||
|
},500)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
emitVisit(){
|
emitVisit(){
|
||||||
|
if(!(this.isRendered && this.isConnected)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.emit({"href":window.location.href,"html":document.documentElement.outerHTML,"title":document.title,"domain":window.location.host})
|
this.emit({"href":window.location.href,"html":document.documentElement.outerHTML,"title":document.title,"domain":window.location.host})
|
||||||
this.addEventListeners()
|
this.addEventListeners()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user