Looks like you can only do that with Google Docs, Slides, Forms and Sheets.
You can create a Google Workspace Add-on (distinct from Editor Add-ons) for Google Drive and leverage CardService. But you'll be limited to a handful of widgets and constrained to a 300px width sidebar to the right of the UI.
Another alternative is to create a Google Chrome extension to inject custom elements into the webpage (but that's outside the realm of Apps Script).