I’m building a Chrome extension for Gmail using InboxSDK v2. My registerComposeViewHandler works perfectly when I click Pop out reply (the floating compose window), but it never fires for an inline reply inside a thread.
Per the docs, sdk.Compose.registerComposeViewHandler should be called whenever a compose view is created — including inline replies:
https://inboxsdk.github.io/inboxsdk-docs/compose/
// content.js
(function() {
InboxSDK.load(2, 'sdk_xxx').then((sdk) => {
console.log('SDK ready');
// Register once, immediately
sdk.Compose.registerComposeViewHandler((composeView) => {
console.log('ComposeView detected') // Never logged if inline reply
});
});
})();
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0.0",
"permissions": [],
"host_permissions": ["https://mail.google.com/*"],
"content_scripts": [
{
"matches": ["https://mail.google.com/*"],
"js": ["content.js"],
"run_at": "document_end" // also tried "document_start"
}
],
"web_accessible_resources": [{
"resources": ["*"],
"matches": ["https://mail.google.com/*"]
}]
}
Registering the compose handler as early as possible, immediately after InboxSDK.load resolves (no extra async gating).
Switching run_at between "document_start" and "document_end".
Ensuring the handler is registered exactly once (no duplicate registrations).
Using Conversations.registerThreadViewHandler to enumerate existing compose views:
sdk.Conversations.registerThreadViewHandler((threadView) => {
try { threadView.getComposeViews().forEach(cv => console.log('Existing CV', cv)); } catch {}
threadView.on('reply', ({composeView}) => console.log('Reply CV', composeView));
threadView.on('forward', ({composeView}) => console.log('Fwd CV', composeView));
});
Even then, the inline reply doesn’t trigger my original compose handler.
Verifying that no feature flags, settings, or licensing checks block registration (handler registration happens unconditionally).
Testing with a fresh profile and no other Gmail extensions.
Is there a known quirk where inline replies don’t emit registerComposeViewHandler under certain conditions? Do I need a different event hook for inline replies, or to wait for a specific Gmail state before they’re detectable?
Any pointers or a working inline-reply repro would be appreciated.
Update "@inboxsdk/core" npm package to : "^2.2.8",