in script.js [14:48]
function fbmcc_setupCustomerChat() {
const FACEBOOK_URL = "https://www.facebook.com";
var baseURL = "https://www.facebook.com/customer_chat/dialog/?domain=";
var urlParam = encodeURI(
window.location.protocol
+ '//'
+ window.location.hostname
+ (window.location.port ? ':' + window.location.port : '')
);
var customerWindow = window.open(
baseURL + urlParam,
"_blank",
"width=1200,height=800"
);
jQuery(window).on("message", function(e) {
if (e.originalEvent.origin === FACEBOOK_URL) {
$data_json = JSON.parse(e.originalEvent.data);
var data = {
'action' : 'fbmcc_update_options',
'pageID' : fbmcc_sanitizeNumbersOnly($data_json["pageID"]),
'locale' : fbmcc_sanitizeLocale($data_json["locale"]),
'_wpnonce' : ajax_object.nonce,
};
jQuery.ajax({
type: 'POST',
url: ajax_object.ajaxurl,
data: data,
success: function(results) {
jQuery('#fbmcc-page-params').css('display', 'inline-block');
}
});
}
});
}