-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you think it's possible to catch console output? #5
Comments
Yeah I think it is possible! For Android it is very simple: I need to add the onConsoleMessage method. For iOS I think I can use something like: |
That sounds great for me :) what do you think about timing? This year, ore morely unknown? Thanks for fast response 👍 |
…t a return value, added InAppBrowser.onConsoleMessage() method to manage console messages #5
@flddr released new version 0.2.1! Now you can use and overidde the Quick example: class MyInAppBrowser extends InAppBrowser {
@override
Future onLoadStop(String url) async {
// console messages
await this.injectScriptCode("console.log({'testObject': 5});"); // the message will be: [object Object]
await this.injectScriptCode("console.log('testObjectStringify', JSON.stringify({'testObject': 5}));"); // the message will be: testObjectStringify {"testObject": 5}
await this.injectScriptCode("console.error('testError', false);"); // the message will be: testError false
}
@override
void onConsoleMessage(ConsoleMessage consoleMessage) {
print("""
console output:
sourceURL: ${consoleMessage.sourceURL}
lineNumber: ${consoleMessage.lineNumber}
message: ${consoleMessage.message}
messageLevel: ${consoleMessage.messageLevel}
""");
}
} You can find the example in the README.md file 😄 |
Wow! Unbelievable 💯 Thank you very much 🤗 |
Can i ask you another question? I am figuring out if it is possible in flutter to build a dev tool with control over complete request structure and i want to get raw response as |
@flddr I think that something could be done |
@pichillilorenzo i tried to get some info here dart-lang/http#207 but actually not... I am newbie to dart, so just looking if it could be a good idea... What do you think? Thank you :) |
So you need to use the Socket class! In this way I think you could manage raw requests/responses! See this example: https://stackoverflow.com/questions/51077233/how-can-i-use-socket-in-flutter-app |
…nged Implement onTitleChanged
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Thanks for your work.
I would like to test this, but, the question in title is also interesting to me :)
The text was updated successfully, but these errors were encountered: