diff --git a/frontend/src/components/CustomAppFrame.vue b/frontend/src/components/CustomAppFrame.vue index 1b11e4f..fdbd4d5 100644 --- a/frontend/src/components/CustomAppFrame.vue +++ b/frontend/src/components/CustomAppFrame.vue @@ -17,6 +17,7 @@ import type { } from '@/types/apps' import { createCustomAppBridgeRequestHandler, + getCustomAppFrameBootstrapMessages, getSkyPhoneAppCapabilities, shouldReportCustomAppReady, } from '@/utils/customAppBridge' @@ -266,6 +267,11 @@ function onFrameLoad(): void { loadTimeout = undefined } frameLoaded.value = true + for (const message of getCustomAppFrameBootstrapMessages( + props.app.compatibility, + )) { + postToFrame(message) + } if (props.app.bridgeMode === 'legacy' || skyBridgeReady.value) { frameUnavailable.value = false } @@ -331,7 +337,6 @@ watch(() => catalog.openRequests[props.app.id], flushOpenRequest, { :class="{ 'custom-app-frame--fix-blur': app.compatibility.fixBlur === true, }" - :name="app.ownerResource" :sandbox="sandbox" :src="frameUrl" :title="app.name" diff --git a/frontend/src/utils/customAppBridge.test.ts b/frontend/src/utils/customAppBridge.test.ts index db1a77d..4e61985 100644 --- a/frontend/src/utils/customAppBridge.test.ts +++ b/frontend/src/utils/customAppBridge.test.ts @@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { createCustomAppBridgeRequestHandler, + getCustomAppFrameBootstrapMessages, getSkyPhoneAppCapabilities, shouldReportCustomAppReady, type CustomAppBridgeNotification, @@ -60,6 +61,15 @@ describe('custom app bridge', () => { expect(shouldReportCustomAppReady('sky', 'bridge-ready')).toBe(true) }) + it('boots LB Phone frames with their documented ready signal', () => { + expect( + getCustomAppFrameBootstrapMessages({ provider: 'lb_phone' }), + ).toEqual(['componentsLoaded']) + expect( + getCustomAppFrameBootstrapMessages({ provider: '17mov' }), + ).toEqual([]) + }) + it('passes validated storage data and server response data through', async () => { source.capabilities = ['device.storage'] storageCall.mockResolvedValue({ diff --git a/frontend/src/utils/customAppBridge.ts b/frontend/src/utils/customAppBridge.ts index e51a00e..fdde136 100644 --- a/frontend/src/utils/customAppBridge.ts +++ b/frontend/src/utils/customAppBridge.ts @@ -294,6 +294,15 @@ export function shouldReportCustomAppReady( : signal === 'frame-load' } +export function getCustomAppFrameBootstrapMessages( + compatibility: Readonly>, +): readonly unknown[] { + if (compatibility.provider === 'lb_phone') { + return ['componentsLoaded'] + } + return [] +} + export function createCustomAppBridgeRequestHandler( dependencies: CustomAppBridgeDependencies, ): {