diff --git a/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts b/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts index 42f9c41bf53..28c2dd24f25 100644 --- a/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts +++ b/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts @@ -718,12 +718,14 @@ export class BrowserEditor extends EditorPane { name: displayName, fullName: displayName, value: value, - modelDescription: 'Structured browser element context with HTML path, attributes, and computed styles.', + modelDescription: attachCss + ? 'Structured browser element context with HTML path, attributes, and computed styles.' + : 'Structured browser element context with HTML path and attributes.', kind: 'element', icon: ThemeIcon.fromId(Codicon.layout.id), ancestors: elementData.ancestors, attributes: elementData.attributes, - computedStyles: elementData.computedStyles, + computedStyles: attachCss ? elementData.computedStyles : undefined, dimensions: elementData.dimensions, innerText: elementData.innerText, }); @@ -864,9 +866,11 @@ export class BrowserEditor extends EditorPane { sections.push(`Attributes:\n${attributeTable}`); } - const computedStyleTable = this.formatElementMap(elementData.computedStyles); - if (computedStyleTable) { - sections.push(`Computed Styles:\n${computedStyleTable}`); + if (attachCss) { + const computedStyleTable = this.formatElementMap(elementData.computedStyles); + if (computedStyleTable) { + sections.push(`Computed Styles:\n${computedStyleTable}`); + } } if (elementData.dimensions) { diff --git a/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts b/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts index a270c52b91d..382fbd87e08 100644 --- a/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts +++ b/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts @@ -300,7 +300,7 @@ class SimpleBrowserOverlayWidget { icon: ThemeIcon.fromId(Codicon.layout.id), ancestors: elementData.ancestors, attributes: elementData.attributes, - computedStyles: elementData.computedStyles, + computedStyles: attachCss ? elementData.computedStyles : undefined, dimensions: elementData.dimensions, innerText: elementData.innerText, });