Skip to content

Commit 3ed300e

Browse files
authored
Add simple browser extension (#109276)
* Add support for TS's Hierarchical refactorings API microsoft/TypeScript#41975 * Add simple browser extension This change adds a new 'simple browser' extension. This extension uses a webview to render webpages directly in VS Code. We plan on using it for optionally previewing local servers in both desktop and codespaces The browser itself has a number of limitations due to the security around iframes: - It traps keyboard focus - We can't detect if a page fails to load - We can't track the current url of the iframe * Add experimental alert when the iframe is focused * Disable events on focus warning * Hooking up simple browser to opener
1 parent 69dfa67 commit 3ed300e

25 files changed

+3585
-0
lines changed

Diff for: build/gulpfile.extensions.js

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const compilations = [
5959
'php-language-features/tsconfig.json',
6060
'python/tsconfig.json',
6161
'search-result/tsconfig.json',
62+
'simple-browser/tsconfig.json',
6263
'typescript-language-features/test-workspace/tsconfig.json',
6364
'typescript-language-features/tsconfig.json',
6465
'vscode-api-tests/tsconfig.json',

Diff for: build/hygiene.js

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const indentationFilter = [
9393
'!**/*.Dockerfile',
9494
'!**/*.dockerfile',
9595
'!extensions/markdown-language-features/media/*.js',
96+
'!extensions/simple-browser/media/*.js',
9697
];
9798

9899
const copyrightFilter = [

Diff for: build/npm/dirs.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ exports.dirs = [
3434
'extensions/npm',
3535
'extensions/php-language-features',
3636
'extensions/search-result',
37+
'extensions/simple-browser',
3738
'extensions/typescript-language-features',
3839
'extensions/vscode-api-tests',
3940
'extensions/vscode-colorize-tests',

Diff for: extensions/simple-browser/.vscodeignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
test/**
2+
test-workspace/**
3+
src/**
4+
tsconfig.json
5+
out/test/**
6+
out/**
7+
extension.webpack.config.js
8+
extension-browser.webpack.config.js
9+
cgmanifest.json
10+
yarn.lock
11+
preview-src/**
12+
webpack.config.js

Diff for: extensions/simple-browser/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Simple Browser files
2+
3+
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
//@ts-check
7+
8+
'use strict';
9+
10+
const withBrowserDefaults = require('../shared.webpack.config').browser;
11+
12+
module.exports = withBrowserDefaults({
13+
context: __dirname,
14+
entry: {
15+
extension: './src/extension.ts'
16+
}
17+
});
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
//@ts-check
7+
8+
'use strict';
9+
10+
const withDefaults = require('../shared.webpack.config');
11+
12+
module.exports = withDefaults({
13+
context: __dirname,
14+
resolve: {
15+
mainFields: ['module', 'main']
16+
},
17+
entry: {
18+
extension: './src/extension.ts',
19+
}
20+
});

Diff for: extensions/simple-browser/media/index.js

+201
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: extensions/simple-browser/media/index.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)