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

build/gulpfile.extensions.js

Lines changed: 1 addition & 0 deletions
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',

build/hygiene.js

Lines changed: 1 addition & 0 deletions
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 = [

build/npm/dirs.js

Lines changed: 1 addition & 0 deletions
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',
Lines changed: 12 additions & 0 deletions
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

extensions/simple-browser/README.md

Lines changed: 3 additions & 0 deletions
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.
Lines changed: 17 additions & 0 deletions
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+
});
Lines changed: 20 additions & 0 deletions
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+
});

extensions/simple-browser/media/index.js

Lines changed: 201 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/simple-browser/media/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)