1// NativeCommunicator 2 3var cdContext = cdContext || {}; 4 5(function (exports) { 6 "use strict"; 7 8 exports.NativeCommunicator = class NativeCommunicator { 9 10 messageCallback(e) { 11 var msg = e.data; 12 13 switch (msg.msgType) { 14 case 'dataFromSlave': 15 this.sendToNative(msg.msgType, msg.data); 16 break; 17 case 'iosHandshake': 18 if (msg.data && msg.data === "CDHandShake" && msg.isNative) 19 this.sendToNative("registerSlave", ""); 20 break; 21 case 'logPerfSlave': 22 msg.data.eventName && this.sendToNative(msg.msgType, msg.data); 23 break; 24 case 'updateMasterContext': 25 this.sendToNative(msg.msgType, msg.data); 26 break; 27 } 28 } 29 30 listen() { 31 window.addEventListener('message', this.messageCallback.bind(this)); 32 } 33 34 sendToNative(msgType, data) { 35 biocatchBridge && biocatchBridge.callHandler(msgType, data || []); 36 } 37 } 38 39 new exports.NativeCommunicator().listen(); 40 41 })(cdContext); 42 43// jsBridge 44var biocatchBridge; 45 46function BCHandleOnLoad() { 47 setupWebViewJavascriptBridge(function(bridge) { 48 49 /* Initialize your app here */ 50 biocatchBridge = bridge; 51 52 }) 53} 54 55function setupWebViewJavascriptBridge(callback) { 56 if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); } 57 if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); } 58 window.WVJBCallbacks = [callback]; 59 var WVJBIframe = document.createElement('iframe'); 60 WVJBIframe.style.display = 'none'; 61 WVJBIframe.src = 'https://--bridge-loaded--'; 62 document.documentElement.appendChild(WVJBIframe); 63 setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0) 64}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.