File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ describe("canvas host", () => {
145145 expect ( html ) . toContain ( "Interactive test page" ) ;
146146 expect ( html ) . toContain ( "openclawSendUserAction" ) ;
147147 expect ( html ) . toContain ( CANVAS_WS_PATH ) ;
148+ expect ( html ) . toContain ( 'document.createElement("span")' ) ;
149+ expect ( html ) . not . toContain ( "statusEl.innerHTML" ) ;
148150 } finally {
149151 await server . close ( ) ;
150152 }
Original file line number Diff line number Diff line change @@ -121,11 +121,18 @@ function defaultIndexHTML() {
121121 typeof window.openclawCanvasA2UIAction.postMessage === "function")
122122 );
123123 const hasHelper = () => typeof window.openclawSendUserAction === "function";
124- statusEl.innerHTML =
125- "Bridge: " +
126- (hasHelper() ? "<span class='ok'>ready</span>" : "<span class='bad'>missing</span>") +
127- " · iOS=" + (hasIOS() ? "yes" : "no") +
128- " · Android=" + (hasAndroid() ? "yes" : "no");
124+ const helperReady = hasHelper();
125+ statusEl.textContent = "";
126+ statusEl.appendChild(document.createTextNode("Bridge: "));
127+ const bridgeStatus = document.createElement("span");
128+ bridgeStatus.className = helperReady ? "ok" : "bad";
129+ bridgeStatus.textContent = helperReady ? "ready" : "missing";
130+ statusEl.appendChild(bridgeStatus);
131+ statusEl.appendChild(
132+ document.createTextNode(
133+ " · iOS=" + (hasIOS() ? "yes" : "no") + " · Android=" + (hasAndroid() ? "yes" : "no"),
134+ ),
135+ );
129136
130137 const onStatus = (ev) => {
131138 const d = ev && ev.detail || {};
You can’t perform that action at this time.
0 commit comments