I’m developing a reporting Add-on using a ServiceM8 Add-on Menu Item.
The Add-on UI fills the width available inside its document, but the Menu Item iframe appears not to use the full horizontal space available in the ServiceM8 web interface.
Is the width of a Menu Item iframe controlled entirely by ServiceM8, or is there a supported way for an Add-on to request/use a wider canvas?
I can see SMClient.resizeWindow() in the SDK, but the documentation appears to describe that for popup Job/Client actions rather than Menu Items.
Add-ons opened through a Menu Item automatically fill the available page width—no resize command is needed.
You’re correct that SMClient.resizeWindow() is for popup windows, such as Job and Client actions.
If your reporting add-on still appears narrower, please share a screenshot showing the full ServiceM8 window and the add-on name so we can investigate further.
I’ve now tracked it down and the issue was on my side rather than ServiceM8.
I had an old hard-coded height limit on the report Preview which was restricting the vertical space inside the Menu Item iframe. Once removed and the Preview layout adjusted properly, it now uses the available space as expected and is working really nicely.
So no investigation needed your end after all — but your confirmation that Menu Items should fill the available page space was exactly what prompted me to go back through the layout properly.
The Menu Item iframe/container is provided by ServiceM8, with your add-on’s output rendered into the ServiceM8 UI inside an iframe. In the current Add-on SDK docs, Menu Items are documented as entries under the web Add-ons menu or app More menu, and the manifest fields shown for menuItems are name, type, iconURL, and event, with no documented width/height or wider-canvas setting.
SMClient.resizeWindow() is documented for add-on events launched in a popup window, such as Job actions and Client actions, and its arguments resize the popup window width and height. So we don’t document it as a way to widen an Add-on Menu Item iframe.
For a reporting Add-on opened as a Menu Item, you’ll need to build the UI to work within the ServiceM8-provided canvas.
Thanks for confirming that. I actually managed to track the issue down on my side after your earlier reply — it turned out to be an old height constraint in my own CSS rather than a limitation with the ServiceM8 Menu Item canvas.
I’ve removed that and the reporting layout is now using the available space properly inside the ServiceM8 iframe.
So all sorted here, but your clarification on how Menu Items and resizeWindow() behave was really helpful in narrowing it down.