| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Returns true if running inside a vscode webview. |
| 10 | * Could also be checked via the ISL Platform, but |
| 11 | * that's only valid in ISL, and not more lightweight webviews |
| 12 | * like the inline comments. This check should be valid with no additional setup. |
| 13 | */ |
| 14 | export function isVscode() { |
| 15 | return window.location.protocol === 'vscode-webview:'; |
| 16 | } |
| 17 | |