hlwhl / webview_cef

WebView for Flutter Desktop Apps using CEF(Chromium Embedded Framework) [Work in Progress]
Apache License 2.0
176 stars 52 forks source link

Receiving Console Messages #93

Closed bahricanyesil closed 9 months ago

bahricanyesil commented 10 months ago

How can I receive the console messages in the dart code (the ones printed as logs)? @SinyimZhi

SinyimZhi commented 10 months ago

sry,i didnt get your meant. can you put a screen shot show what messages you need? @bahricanyesil

bahricanyesil commented 10 months ago

sry,i didnt get your meant. can you put a screen shot show what messages you need? @bahricanyesil

I am asking for the corresponding way to listen console messages like we have "onConsoleMessage" parameter in the flutter_inappwebview package. @SinyimZhi

I want to trigger a function when an information from the console is received like the below message (you are already logging them).

Screenshot 2023-12-07 at 21 27 33
SinyimZhi commented 9 months ago

sry,i didnt get your meant. can you put a screen shot show what messages you need? @bahricanyesil

I am asking for the corresponding way to listen console messages like we have "onConsoleMessage" parameter in the flutter_inappwebview package. @SinyimZhi

I want to trigger a function when an information from the console is received like the below message (you are already logging them). Screenshot 2023-12-07 at 21 27 33

@bahricanyesil I've checked inappwebview's doc, i recorgnized that you meant javascript console,right? Unfortunately, our project does not have this function on the CEF side right now.But I found there is a way that can just use js code to realize. You can try to excute these codes and use jschannel to trigger your function.

bahricanyesil commented 9 months ago

sry,i didnt get your meant. can you put a screen shot show what messages you need? @bahricanyesil

I am asking for the corresponding way to listen console messages like we have "onConsoleMessage" parameter in the flutter_inappwebview package. @SinyimZhi I want to trigger a function when an information from the console is received like the below message (you are already logging them). Screenshot 2023-12-07 at 21 27 33

@bahricanyesil I've checked inappwebview's doc, i recorgnized that you meant javascript console,right? Unfortunately, our project does not have this function on the CEF side right now.But I found there is a way that can just use js code to realize. You can try to excute these codes and use jschannel to trigger your function.

Yep, I meant javascript console. I could not succeed it, but thanks for the response and your help.

alldev commented 9 months ago

Feature of proper console processing is very high demand. Was upset to be unable to track JS console messages while I can definitely see them in console output. Probably this outputs come from deep inside CEF, I was unable to wrap them with runZoned (like this way).

Hope this feature can be set to the top priority one. Working with console is one of primary purposes of working with webview itself.

SinyimZhi commented 9 months ago

Feature of proper console processing is very high demand. Was upset to be unable to track JS console messages while I can definitely see them in console output. Probably this outputs come from deep inside CEF, I was unable to wrap them with runZoned (like this way).

Hope this feature can be set to the top priority one. Working with console is one of primary purposes of working with webview itself.

okay,i get it. I will check todo lists and work it in progress. @alldev @bahricanyesil

alldev commented 9 months ago

Many thanks, @SinyimZhi, we are looking forward to your further progress. The concept of reading console messages to track logs is way better than using Channels, which are too overengineered compared to the basic concept of logs.

fufylev commented 9 months ago

@SinyimZhi Hi there! Looking forward to fixing this issue. Would be very appreciated for the answer!

SinyimZhi commented 9 months ago

The newest version support get console messages from webview_event_listener @fufylev @alldev @bahricanyesil