WebChromeClient 的 onConsoleMessage 未捕获嵌套对象

问题描述 投票:0回答:0

我有一个

WebView
WebChromeClient
设置为捕获控制台日志

            this.setWebChromeClient(object : WebChromeClient() {
            override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean {
                Log.d("WebView Console Logs", consoleMessage.message())
                return true
            }
        })

控制台日志有这样的嵌套对象

sendCKSession {isICDP: false, ckSession: '46__53__AZ5uHA2kBwzzONCyVNuHNutNbV3SLzNYjfC+s30sru…SVm9uSERQT2RnZEZzd2VTS1djTlZTVGYvZjBnZDlWTmU5In0=', permissions: Array(1), appInfo: {…}, pcsDeleted: false, …}appInfo: {AppId: '1261755406', ContainerId: 'iCloud.Wasiq.Migraine', AdditionalSalt: 'b440efde65bb8c1f45464598470f4cc73977f2c10d6c40587588ec9f1c1c56f0', LogoURL: 'https://is1-ssl.mzstatic.com/image/thumb/Purple114…07emarketing-0-0-0-7-0-0-85-220.png/512x512bb.png', AppDiscoverable: 'false', …}ckSession: "46__53__AZ5uHA2kBwzzONCyVNuHNutNbV3SLzNYjfC+s30srufbRfzTP3KbOAhf0EizHZUYalHLbawTle6UEIzXr5rQIwS/m3Hu4edp4GKxArcPdSkUpcuUJ4h3fEk0d5nY3emz5iAM6Oe2JMH6TP2z0RCBI1yffQjomvyAXhrKAgHVpdonLM6xv9Xu+qI+YLdyS30Q3HC/gutjYUF/MalaMmvi2Cf9/rV9b92fGcy6usVSuS2/XHdVmgO+fc1CYN4f5rvAQNOrYuZhCokP5KaNDEvdmjrd6zTNmbCh34Lgga82D2SM+Lla1RlHOZQFUDrQJL2GO4u/mEI5oGjnGnR5nNQ178PqZ2eC+odYshiFYaQJYB4AFeAitXeuZpgiyzrmjZdLaAMSfYJG23T3G+YBHUKEmmj1NZWOZ7pQs2b9q5cHtKkl1Q==__eyJYLUFQUExFLVdFQkFVVEgtUENTLUNsb3Vka2l0IjoiUVhCd2JEb3hPZ0c4N2g1d3FydGtVUnVVRG1TVUNVOUJaRmVOQmgxd1ZVTVc1WkhzcTlMYUtjanBOWVJoTFFyK05vL25lZXBsaE0ybk1SY2tjcjMvYksxWjlxQld2cy91IiwiWC1BUFBMRS1XRUJBVVRILVBDUy1TaGFyaW5nIjoiUVhCd2JEb3hPZ0crTktqSGNqbVoxVUFKZ2FCNHV0NytxdElrZGJDaGhleGs1WmV6UUJBWVR3bDEzME93aWxSVm9uSERQT2RnZEZzd2VTS1djTlZTVGYvZjBnZDlWTmU5In0="isICDP: falsepcsDeleted: falsepermissions: [{…}]status: 0[[Prototype]]: Object

我想捕捉

ckSession
内的
sendCKSession

物体

但是,在Logcat上,我只看到

sendCKSession [object Object]

如何解析对象并获取 ckSession?

javascript android kotlin webview webchromeclient
© www.soinside.com 2019 - 2024. All rights reserved.