Here is the method in builder.js that causes the message to be shown:
S = (function () {
function e() {}
return (
(e.prototype.registerListener = function (e, t, n) {
window.addEventListener("message", this.makeReceiveMessage(e, t, n));
}),
(e.prototype.makeReceiveMessage = function (e, t, n) {
var i = this;
return function (r) {
return _(i, void 0, void 0, function () {
var i;
return P(this, function (o) {
return r.data && r.data.hasOwnProperty("msg") &&
r.data.msg.startsWith("Kentico.")
? f.arrayHelper.contains(n, r.origin.toLowerCase())
? [2, this.processIncomingMessage(e, t)(r)]
: ((i = (0, p.getService)(m.SERVICE_TYPES.LocalizationService).getLocalization("messaging.forbiddenorigin")), (i = f.stringHelper.format(i, r.origin)), y.logger.logError(i), [2])
: [2];
});
});
};
}),
(e.prototype.processIncomingMessage = function (e, t) {
var n = this;
return function (r) {
return _(n, void 0, void 0, function () {
var n, o;
return P(this, function (a) {
switch (a.label) {
case 0:
if (r.data.msg !== m.MessageTypes.SAVE_CONFIGURATION) return [3, 5];
a.label = 1;
case 1:
return a.trys.push([1, 4, , 5]), r.data.contentModified ? [4, (0, l.saveState)(e(), r.data.guid)] : [3, 3];
case 2:
a.sent(), (a.label = 3);
case 3:
return (0, v.postMessage)(m.MessageTypes.CONFIGURATION_STORED, (0, i.default)(e().displayedWidgetVariants), r.origin), [3, 5];
case 4:
return (n = a.sent()), y.logger.logException(n), [3, 5];
case 5:
return (
r.data.msg === m.MessageTypes.LOAD_DISPLAYED_WIDGET_VARIANTS && ((o = JSON.parse(r.data.data) || {}), t((0, h.restoreDisplayedWidgetVariants)(o))),
r.data.msg !== m.MessageTypes.SAVE_TEMP_CONFIGURATION ? [3, 8] : r.data.contentModified ? [4, (0, l.saveState)(e(), r.data.guid)] : [3, 7]
);
case 6:
a.sent(), (a.label = 7);
case 7:
(0, v.postMessage)(m.MessageTypes.TEMP_CONFIGURATION_STORED, null, r.origin), (a.label = 8);
case 8:
return r.data.msg === m.MessageTypes.CONFIRM_RESPONSE && (0, g.handleConfirm)(r.data.result), [2];
}
});
});
};
}),
(e = w([(0, s.injectable)()], e))
);
})();
t.MessagingService = S;
}