I’m responding to a GET request with JSON data (Content-Type
application/json; charset=utf-8), but it keeps tacking on this random script to every response and I cannot get rid of it no matter what I do:
37 requests
720.83 kB / 707.49 kB transferred
Finish: 602 ms
DOMContentLoaded: 214 ms
load: 476 ms
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 503 of the JSON data
{"expected_data":"values"}<script>
(function() {
var ws = new WebSocket('ws://' + window.location.host +
'/jb-server-page?reloadMode=RELOAD_ON_SAVE&'+
'referrer=' + encodeURIComponent(window.location.pathname));
ws.onmessage = function (msg) {
if (msg.data === 'reload') {
window.location.reload();
}
if (msg.data.startsWith('update-css ')) {
var messageId = msg.data.substring(11);
var links = document.getElementsByTagName('link');
for (var i = 0; i < links.length; i++) {
var link = links[i];
if (link.rel !== 'stylesheet') continue;
var clonedLink = link.cloneNode(true);
var newHref = link.href.replace(/(&|?)jbUpdateLinksId=d+/, "$1jbUpdateLinksId=" + messageId);
if (newHref !== link.href) {
clonedLink.href = newHref;
}
else {
var indexOfQuest = newHref.indexOf('?');
if (indexOfQuest >= 0) {
// to support ?foo#hash
clonedLink.href = newHref.substring(0, indexOfQuest + 1) + 'jbUpdateLinksId=' + messageId + '&' +
newHref.substring(indexOfQuest + 1);
}
else {
clonedLink.href += '?' + 'jbUpdateLinksId=' + messageId;
}
}
link.replaceWith(clonedLink);
}
}
};
})();
</script>
Does anyone know where this script is coming from and how I can disable it? I’ve also tried disabling the debugger in both my browser and in PhpStorm.
I’ve searched high and low and I know it has something to do with “live edit”, but I cannot find any options to enable/disable it no matter where I look.