facebookarchive / stetho

Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.
http://facebook.github.io/stetho/
MIT License
12.66k stars 1.13k forks source link

Custom banner in debugger console #602

Closed dant3 closed 5 years ago

dant3 commented 6 years ago

Hi.

Currently there is no way to change the banner inside of the console. I would love to customize that.

I've implemented some additional api exclusively for debugging console via JS bindings. In order to make it easy to use what I want to do is to print some sort of welcome message with help on what is exposed in the console directly and how to use it. I've tried to just do printing into the console but this is not happening until user does not sends anything to the console. Meanwhile banner is always printed beforehand/

longinoa commented 6 years ago

Looking at the code for this it would be pretty easy to do one of 2 different things: 1) Subclass Page (the class that adds the header) and override enable 2) Modify Page to create a non default constructor to take in the string you want to display. You could then send that string in sendWelcomeMessage

Either of these cases would require you to call Stetho.DefaultDumperPluginsBuilder#remove(...) and then add your own variant.

There is an explicit note in Page that this is not a resource based on the fact that we want to be able to distribute as a jar file otherwise