Created
May 2, 2018 13:19
-
-
Save keshcreations/0491b24124fa1262db6ee39fecd1fdc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.usabilla_live("setEventCallback", function(category, action, label, value) { | |
if(action != "Feedback:Open") { | |
return; | |
} | |
function sendReplacement(vData) { | |
console.log(vData); | |
var data = JSON.parse(vData); | |
data.url = data.url.replace(new RegExp("##"), "#"); //Define which sections you want to mask or encode here. | |
console.log(data); | |
vData = JSON.stringify(data); | |
realSend.apply(this, arguments); | |
} | |
var realSend = XMLHttpRequest.prototype.send; | |
ub_window = document.getElementById('lightningjs-frame-usabilla_live_feedback').contentWindow; | |
ub_window.XMLHttpRequest.prototype.send = sendReplacement; | |
if(window.XDomainRequest) { | |
realSend = XDomainRequest.prototype.send; | |
ub_window.XDomainRequest.prototype.send = sendReplacement; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment