Skip to content

Instantly share code, notes, and snippets.

@keshcreations
Created May 2, 2018 13:19
Show Gist options
  • Save keshcreations/0491b24124fa1262db6ee39fecd1fdc4 to your computer and use it in GitHub Desktop.
Save keshcreations/0491b24124fa1262db6ee39fecd1fdc4 to your computer and use it in GitHub Desktop.
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