Skip to content

Instantly share code, notes, and snippets.

@luckydevilru
Last active September 25, 2023 09:32
Show Gist options
  • Save luckydevilru/b256c2b682d843bdc875b107f01bcb89 to your computer and use it in GitHub Desktop.
Save luckydevilru/b256c2b682d843bdc875b107f01bcb89 to your computer and use it in GitHub Desktop.
Логирования js событий bitrix bitrix24
let originalBxOnCustomEvent = BX.onCustomEvent;
BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams)
{
let realEventName = BX.type.isString(eventName) ?
eventName : BX.type.isString(eventObject) ? eventObject : null;
let i = 0;
console.log('realEventName', realEventName);
console.log(
"%c" + realEventName + " - " + new Date().toLocaleTimeString(),
"font-weight: bold; padding: 3px 4px;"
);
console.log(
"eventParams",
eventParams
);
console.dir({
eventObject: eventObject,
eventParams: eventParams,
secureParams: secureParams
});
originalBxOnCustomEvent.apply(
null, arguments
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment