Find code that runs behind buttons in WebViewer

WebViewer Version: 8.8.0

I am trying to change the way the viewer header behaves in “small mobile” mode. In doing so I’d like to see what happens when a particular button in the viewer (right now it’s the defaultHeaderButton) so that I can perform the same actions as part of my own button/menu item action. But I’m at a loss as to how to discover this. I’ve scoured the documentation for “defaultHeaderButton” to no avail, and looking at the prettified code in the browser also yields no results.

Can you tell me how I can discover this information, not just for this button, for any of them?

Hello @beccanet

The UI repository is actually open source, so you can investigate the code itself to get a precise understanding of what happens when you click a button.

For this specific case, the entry point is this button config object: https://github.com/PDFTron/webviewer-ui/blob/8.9/src/redux/initialState.js#L196

1 Like