@codingame/monaco-vscode-simple-browser-default-extension 1.85.2 → 1.85.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1 +1,20 @@
1
- function s(e){document.readyState==="loading"||document.readyState==="uninitialized"?document.addEventListener("DOMContentLoaded",e):e()}var d=acquireVsCodeApi();function i(){let e=document.getElementById("simple-browser-settings");if(e){let t=e.getAttribute("data-settings");if(t)return JSON.parse(t)}throw new Error("Could not load settings")}var r=i(),c=document.querySelector("iframe"),n=document.querySelector(".header"),a=n.querySelector(".url-input"),l=n.querySelector(".forward-button"),m=n.querySelector(".back-button"),g=n.querySelector(".reload-button"),E=n.querySelector(".open-external-button");window.addEventListener("message",e=>{switch(e.data.type){case"focus":{c.focus();break}case"didChangeFocusLockIndicatorEnabled":{u(e.data.enabled);break}}});s(()=>{setInterval(()=>{let t=document.activeElement?.tagName==="IFRAME";document.body.classList.toggle("iframe-focused",t)},50),c.addEventListener("load",()=>{}),a.addEventListener("change",t=>{let o=t.target.value;e(o)}),l.addEventListener("click",()=>{history.forward()}),m.addEventListener("click",()=>{history.back()}),E.addEventListener("click",()=>{d.postMessage({type:"openExternal",url:a.value})}),g.addEventListener("click",()=>{e(a.value)}),e(r.url),a.value=r.url,u(r.focusLockIndicatorEnabled);function e(t){try{let o=new URL(t);o.searchParams.append("vscodeBrowserReqId",Date.now().toString()),c.src=o.toString()}catch{c.src=t}d.setState({url:t})}});function u(e){document.body.classList.toggle("enable-focus-lock-indicator",e)}
1
+ import { registerExtension } from 'vscode/extensions';
2
+
3
+ var manifest = {name:"simple-browser",displayName:"%displayName%",description:"%description%",enabledApiProposals:["externalUriOpener"],version:"1.0.0",icon:"media/icon.png",publisher:"vscode",license:"MIT",aiKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",engines:{vscode:"^1.70.0"},main:undefined,browser:"./dist/browser/extension",categories:["Other"],extensionKind:["ui","workspace"],activationEvents:["onCommand:simpleBrowser.api.open","onOpenExternalUri:http","onOpenExternalUri:https","onWebviewPanel:simpleBrowser.view"],capabilities:{virtualWorkspaces:true,untrustedWorkspaces:{supported:true}},contributes:{commands:[{command:"simpleBrowser.show",title:"Show",category:"Simple Browser"}],configuration:[{title:"Simple Browser",properties:{"simpleBrowser.focusLockIndicator.enabled":{type:"boolean","default":true,title:"Focus Lock Indicator Enabled",description:"%configuration.focusLockIndicator.enabled.description%"}}}]},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
4
+
5
+ const { registerFileUrl, whenReady } = registerExtension(manifest);
6
+ registerFileUrl('README.md', new URL('./resources/README.md', import.meta.url).toString(), 'text/markdown');
7
+ registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), 'application/json');
8
+ registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), 'application/json');
9
+ registerFileUrl('media/codicon.css', new URL('./resources/codicon.css', import.meta.url).toString(), 'text/css');
10
+ registerFileUrl('media/icon.png', new URL('./resources/icon.png', import.meta.url).toString(), 'image/png');
11
+ registerFileUrl('media/index.js', new URL('./resources/index.js', import.meta.url).toString(), 'application/javascript');
12
+ registerFileUrl('media/index', new URL('./resources/index.js', import.meta.url).toString(), 'application/javascript');
13
+ registerFileUrl('media/main.css', new URL('./resources/main.css', import.meta.url).toString(), 'text/css');
14
+ registerFileUrl('media/preview-dark.svg', new URL('./resources/preview-dark.svg', import.meta.url).toString(), 'image/svg+xml');
15
+ registerFileUrl('media/preview-light.svg', new URL('./resources/preview-light.svg', import.meta.url).toString(), 'image/svg+xml');
16
+ registerFileUrl('dist/browser/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), 'application/javascript');
17
+ registerFileUrl('dist/browser/extension', new URL('./resources/extension.js', import.meta.url).toString(), 'application/javascript');
18
+ registerFileUrl('dist/browser/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), 'application/json');
19
+
20
+ export { whenReady };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-simple-browser-default-extension",
3
- "version": "1.85.2",
3
+ "version": "1.85.4",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -14,10 +14,10 @@
14
14
  "type": "module",
15
15
  "private": false,
16
16
  "description": "Default VSCode extension designed to be used with @codingame/monaco-vscode-api",
17
- "main": "index2.js",
18
- "module": "index2.js",
17
+ "main": "index.js",
18
+ "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.85.2"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.85.4"
22
22
  }
23
23
  }
@@ -0,0 +1,5 @@
1
+ # Simple Browser
2
+
3
+ **Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
4
+
5
+ Provides a very basic browser preview using an iframe embedded in a [webviewW](). This extension is primarily meant to be used by other extensions for showing simple web content.
@@ -0,0 +1,2 @@
1
+ (()=>{"use strict";var t={763:(t,e)=>{function s(t){for(;t.length;)t.pop()?.dispose()}Object.defineProperty(e,"__esModule",{value:!0}),e.$b=e.$a=void 0,e.$a=s,e.$b=class{constructor(){this.a=!1,this.b=[]}dispose(){this.a||(this.a=!0,s(this.b))}c(t){return this.a?t.dispose():this.b.push(t),t}get d(){return this.a}}},625:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.$d=void 0;const n=s(959);e.$d=class{constructor(t){this.b=t}dispose(){this.a?.dispose(),this.a=void 0}show(t,e){const s="string"==typeof t?t:t.toString(!0);if(this.a)this.a.show(s,e);else{const t=n.$c.create(this.b,s,e);this.c(t),this.a=t}}restore(t,e){const s=e?.url??"",i=n.$c.restore(this.b,s,t);this.c(i),this.a??(this.a=i)}c(t){t.onDispose((()=>{this.a===t&&(this.a=void 0)}))}}},959:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.$c=void 0;const n=s(496),i=s(763);class o extends i.$b{static g(t){return[n.Uri.joinPath(t,"media")]}static h(t){return{enableScripts:!0,enableForms:!0,localResourceRoots:o.g(t)}}static create(t,e,s){const i=n.window.createWebviewPanel(o.viewType,o.f,{viewColumn:s?.viewColumn??n.ViewColumn.Active,preserveFocus:s?.preserveFocus},{retainContextWhenHidden:!0,...o.h(t)});return new o(t,e,i)}static restore(t,e,s){return new o(t,e,s)}constructor(t,e,s){super(),this.l=t,this.k=this.c(new n.EventEmitter),this.onDispose=this.k.event,this.j=this.c(s),this.j.webview.options=o.h(t),this.c(this.j.webview.onDidReceiveMessage((t=>{switch(t.type){case"openExternal":try{const e=n.Uri.parse(t.url);n.env.openExternal(e)}catch{}}}))),this.c(this.j.onDidDispose((()=>{this.dispose()}))),this.c(n.workspace.onDidChangeConfiguration((t=>{if(t.affectsConfiguration("simpleBrowser.focusLockIndicator.enabled")){const t=n.workspace.getConfiguration("simpleBrowser");this.j.webview.postMessage({type:"didChangeFocusLockIndicatorEnabled",focusLockEnabled:t.get("focusLockIndicator.enabled",!0)})}}))),this.show(e)}dispose(){this.k.fire(),super.dispose()}show(t,e){this.j.webview.html=this.m(t),this.j.reveal(e?.viewColumn,e?.preserveFocus)}m(t){const e=n.workspace.getConfiguration("simpleBrowser"),s=function(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<64;s++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}(),i=this.n("media","index.js"),o=this.n("media","main.css"),r=this.n("media","codicon.css");return`<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t\t<meta http-equiv="Content-type" content="text/html;charset=UTF-8">\n\n\t\t\t\t<meta http-equiv="Content-Security-Policy" content="\n\t\t\t\t\tdefault-src 'none';\n\t\t\t\t\tfont-src data:;\n\t\t\t\t\tstyle-src ${this.j.webview.cspSource};\n\t\t\t\t\tscript-src 'nonce-${s}';\n\t\t\t\t\tframe-src *;\n\t\t\t\t\t">\n\n\t\t\t\t<meta id="simple-browser-settings" data-settings="${a=JSON.stringify({url:t,focusLockEnabled:e.get("focusLockIndicator.enabled",!0)}),a.toString().replace(/"/g,"&quot;")}">\n\n\t\t\t\t<link rel="stylesheet" type="text/css" href="${o}">\n\t\t\t\t<link rel="stylesheet" type="text/css" href="${r}">\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<header class="header">\n\t\t\t\t\t<nav class="controls">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${n.l10n.t("Back")}"\n\t\t\t\t\t\t\tclass="back-button icon"><i class="codicon codicon-arrow-left"></i></button>\n\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${n.l10n.t("Forward")}"\n\t\t\t\t\t\t\tclass="forward-button icon"><i class="codicon codicon-arrow-right"></i></button>\n\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${n.l10n.t("Reload")}"\n\t\t\t\t\t\t\tclass="reload-button icon"><i class="codicon codicon-refresh"></i></button>\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t<input class="url-input" type="text">\n\n\t\t\t\t\t<nav class="controls">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${n.l10n.t("Open in browser")}"\n\t\t\t\t\t\t\tclass="open-external-button icon"><i class="codicon codicon-link-external"></i></button>\n\t\t\t\t\t</nav>\n\t\t\t\t</header>\n\t\t\t\t<div class="content">\n\t\t\t\t\t<div class="iframe-focused-alert">${n.l10n.t("Focus Lock")}</div>\n\t\t\t\t\t<iframe sandbox="allow-scripts allow-forms allow-same-origin allow-downloads"></iframe>\n\t\t\t\t</div>\n\n\t\t\t\t<script src="${i}" nonce="${s}"><\/script>\n\t\t\t</body>\n\t\t\t</html>`;var a}n(...t){return this.j.webview.asWebviewUri(n.Uri.joinPath(this.l,...t))}}e.$c=o,o.viewType="simpleBrowser.view",o.f=n.l10n.t("Simple Browser")},496:t=>{t.exports=require("vscode")}},e={};function s(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,s),o.exports}var n={};(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const e=s(496),i=s(625),o=s(959),r=new Set(["localhost","127.0.0.1","[0:0:0:0:0:0:0:1]","[::1]","0.0.0.0","[0:0:0:0:0:0:0:0]","[::]"]);t.activate=function(t){const s=new i.$d(t.extensionUri);t.subscriptions.push(s),t.subscriptions.push(e.window.registerWebviewPanelSerializer(o.$c.viewType,{deserializeWebviewPanel:async(t,e)=>{s.restore(t,e)}})),t.subscriptions.push(e.commands.registerCommand("simpleBrowser.show",(async t=>{t||(t=await e.window.showInputBox({placeHolder:e.l10n.t("https://example.com"),prompt:e.l10n.t("Enter url to visit")})),t&&s.show(t)}))),t.subscriptions.push(e.commands.registerCommand("simpleBrowser.api.open",((t,e)=>{s.show(t,e)}))),t.subscriptions.push(e.window.registerExternalUriOpener("simpleBrowser.open",{canOpenExternalUri(t){const s=new URL(t.toString(!0));return r.has(s.hostname)?"undefined"!=typeof navigator&&e.env.uiKind===e.UIKind.Web?e.ExternalUriOpenerPriority.Default:e.ExternalUriOpenerPriority.Option:e.ExternalUriOpenerPriority.None},openExternalUri:t=>s.show(t,{viewColumn:e.window.activeTextEditor?e.ViewColumn.Beside:e.ViewColumn.Active})},{schemes:["http","https"],label:e.l10n.t("Open in simple browser")}))}})();var i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
2
+ //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/af28b32d7e553898b2a91af498b1fb666fdebe0c/extensions/simple-browser/dist/browser/extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.js","mappings":"sCAOA,SAAgBA,EAAGC,GAClB,KAAOA,EAAYC,QACLD,EAAYE,OACnBC,U,kEAHR,OAOA,yBACS,KAAAC,GAAI,EAEF,KAAAC,EAAyB,GAE5BF,UACFG,KAA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OAIzBgF,EAAQG,cAAchG,KAAKiB,EAAOmF,SAASC,gBA7BxB,sBA6BqDF,MAAO7F,IACzEA,IACJA,QAAYW,EAAOS,OAAO4E,aAAa,CACtCC,YAAatF,EAAO8D,KAAKC,EAAE,uBAC3BwB,OAAQvF,EAAO8D,KAAKC,EAAE,yBAIpB1E,GACHwF,EAAQ3F,KAAKG,OAIfuF,EAAQG,cAAchG,KAAKiB,EAAOmF,SAASC,gBA3CrB,0BA2CqD,CAAC/F,EAAiBkB,KAI5FsE,EAAQ3F,KAAKG,EAAKkB,OAGnBqE,EAAQG,cAAchG,KAAKiB,EAAOS,OAAO+E,0BAjCzB,qBAiC6D,CAC5EC,mBAAmBC,GAElB,MAAMC,EAAc,IAAIC,IAAIF,EAAIpG,UAAS,IACzC,OAAIoF,EAAamB,IAAIF,EAAYG,UAqBP,oBAAdC,WAA6B/F,EAAO8B,IAAIkE,SAAWhG,EAAOiG,OAAOC,IAnBzElG,EAAOmG,0BAA0BC,QACjCpG,EAAOmG,0BAA0BE,OAG9BrG,EAAOmG,0BAA0BG,MAEzCC,gBAAgBC,GACR3B,EAAQ3F,KAAKsH,EAAY,CAC/B3F,WAAYb,EAAOS,OAAOgG,iBAAmBzG,EAAOc,WAAW4F,OAAS1G,EAAOc,WAAWC,UAG1F,CACF4F,QAAS,CAAC,OAAQ,SAClBC,MAAO5G,EAAO8D,KAAKC,EAAE,+B","sources":["webpack://simple-browser/./src/dispose.ts","webpack://simple-browser/./src/simpleBrowserManager.ts","webpack://simple-browser/./src/simpleBrowserView.ts","webpack://simple-browser/external commonjs \"vscode\"","webpack://simple-browser/webpack/bootstrap","webpack://simple-browser/./src/extension.ts"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\n\nexport function $a(disposables: vscode.Disposable[]) {\n\twhile (disposables.length) {\n\t\tconst item = disposables.pop();\n\t\titem?.dispose();\n\t}\n}\n\nexport abstract class $b {\n\tprivate a = false;\n\n\tprotected b: vscode.Disposable[] = [];\n\n\tpublic dispose(): any {\n\t\tif (this.a) {\n\t\t\treturn;\n\t\t}\n\t\tthis.a = true;\n\t\t$a(this.b);\n\t}\n\n\tprotected c<T extends vscode.Disposable>(value: T): T {\n\t\tif (this.a) {\n\t\t\tvalue.dispose();\n\t\t} else {\n\t\t\tthis.b.push(value);\n\t\t}\n\t\treturn value;\n\t}\n\n\tprotected get d() {\n\t\treturn this.a;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { ShowOptions, $c } from './simpleBrowserView';\n\nexport class $d {\n\n\tprivate a?: $c;\n\n\tconstructor(\n\t\tprivate readonly b: vscode.Uri,\n\t) { }\n\n\tdispose() {\n\t\tthis.a?.dispose();\n\t\tthis.a = undefined;\n\t}\n\n\tpublic show(inputUri: string | vscode.Uri, options?: ShowOptions): void {\n\t\tconst url = typeof inputUri === 'string' ? inputUri : inputUri.toString(true);\n\t\tif (this.a) {\n\t\t\tthis.a.show(url, options);\n\t\t} else {\n\t\t\tconst view = $c.create(this.b, url, options);\n\t\t\tthis.c(view);\n\n\t\t\tthis.a = view;\n\t\t}\n\t}\n\n\tpublic restore(panel: vscode.WebviewPanel, state: any): void {\n\t\tconst url = state?.url ?? '';\n\t\tconst view = $c.restore(this.b, url, panel);\n\t\tthis.c(view);\n\t\tthis.a ??= view;\n\t}\n\n\tprivate c(view: $c) {\n\t\tview.onDispose(() => {\n\t\t\tif (this.a === view) {\n\t\t\t\tthis.a = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { $b } from './dispose';\n\n\nexport interface ShowOptions {\n\treadonly preserveFocus?: boolean;\n\treadonly viewColumn?: vscode.ViewColumn;\n}\n\nexport class $c extends $b {\n\n\tpublic static readonly viewType = 'simpleBrowser.view';\n\tprivate static readonly f = vscode.l10n.t(\"Simple Browser\");\n\n\tprivate static g(extensionUri: vscode.Uri): readonly vscode.Uri[] {\n\t\treturn [\n\t\t\tvscode.Uri.joinPath(extensionUri, 'media')\n\t\t];\n\t}\n\n\tprivate static h(extensionUri: vscode.Uri): vscode.WebviewOptions {\n\t\treturn {\n\t\t\tenableScripts: true,\n\t\t\tenableForms: true,\n\t\t\tlocalResourceRoots: $c.g(extensionUri),\n\t\t};\n\t}\n\n\tprivate readonly j: vscode.WebviewPanel;\n\n\tprivate readonly k = this.c(new vscode.EventEmitter<void>());\n\tpublic readonly onDispose = this.k.event;\n\n\tpublic static create(\n\t\textensionUri: vscode.Uri,\n\t\turl: string,\n\t\tshowOptions?: ShowOptions\n\t): $c {\n\t\tconst webview = vscode.window.createWebviewPanel($c.viewType, $c.f, {\n\t\t\tviewColumn: showOptions?.viewColumn ?? vscode.ViewColumn.Active,\n\t\t\tpreserveFocus: showOptions?.preserveFocus\n\t\t}, {\n\t\t\tretainContextWhenHidden: true,\n\t\t\t...$c.h(extensionUri)\n\t\t});\n\t\treturn new $c(extensionUri, url, webview);\n\t}\n\n\tpublic static restore(\n\t\textensionUri: vscode.Uri,\n\t\turl: string,\n\t\twebviewPanel: vscode.WebviewPanel,\n\t): $c {\n\t\treturn new $c(extensionUri, url, webviewPanel);\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly l: vscode.Uri,\n\t\turl: string,\n\t\twebviewPanel: vscode.WebviewPanel,\n\t) {\n\t\tsuper();\n\n\t\tthis.j = this.c(webviewPanel);\n\t\tthis.j.webview.options = $c.h(l);\n\n\t\tthis.c(this.j.webview.onDidReceiveMessage(e => {\n\t\t\tswitch (e.type) {\n\t\t\t\tcase 'openExternal':\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst url = vscode.Uri.parse(e.url);\n\t\t\t\t\t\tvscode.env.openExternal(url);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Noop\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}));\n\n\t\tthis.c(this.j.onDidDispose(() => {\n\t\t\tthis.dispose();\n\t\t}));\n\n\t\tthis.c(vscode.workspace.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration('simpleBrowser.focusLockIndicator.enabled')) {\n\t\t\t\tconst configuration = vscode.workspace.getConfiguration('simpleBrowser');\n\t\t\t\tthis.j.webview.postMessage({\n\t\t\t\t\ttype: 'didChangeFocusLockIndicatorEnabled',\n\t\t\t\t\tfocusLockEnabled: configuration.get<boolean>('focusLockIndicator.enabled', true)\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis.show(url);\n\t}\n\n\tpublic override dispose() {\n\t\tthis.k.fire();\n\t\tsuper.dispose();\n\t}\n\n\tpublic show(url: string, options?: ShowOptions) {\n\t\tthis.j.webview.html = this.m(url);\n\t\tthis.j.reveal(options?.viewColumn, options?.preserveFocus);\n\t}\n\n\tprivate m(url: string) {\n\t\tconst configuration = vscode.workspace.getConfiguration('simpleBrowser');\n\n\t\tconst nonce = getNonce();\n\n\t\tconst mainJs = this.n('media', 'index.js');\n\t\tconst mainCss = this.n('media', 'main.css');\n\t\tconst codiconsUri = this.n('media', 'codicon.css');\n\n\t\treturn /* html */ `<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t\t<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\">\n\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"\n\t\t\t\t\tdefault-src 'none';\n\t\t\t\t\tfont-src data:;\n\t\t\t\t\tstyle-src ${this.j.webview.cspSource};\n\t\t\t\t\tscript-src 'nonce-${nonce}';\n\t\t\t\t\tframe-src *;\n\t\t\t\t\t\">\n\n\t\t\t\t<meta id=\"simple-browser-settings\" data-settings=\"${escapeAttribute(JSON.stringify({\n\t\t\turl: url,\n\t\t\tfocusLockEnabled: configuration.get<boolean>('focusLockIndicator.enabled', true)\n\t\t}))}\">\n\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${mainCss}\">\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${codiconsUri}\">\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<header class=\"header\">\n\t\t\t\t\t<nav class=\"controls\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Back\")}\"\n\t\t\t\t\t\t\tclass=\"back-button icon\"><i class=\"codicon codicon-arrow-left\"></i></button>\n\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Forward\")}\"\n\t\t\t\t\t\t\tclass=\"forward-button icon\"><i class=\"codicon codicon-arrow-right\"></i></button>\n\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Reload\")}\"\n\t\t\t\t\t\t\tclass=\"reload-button icon\"><i class=\"codicon codicon-refresh\"></i></button>\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t<input class=\"url-input\" type=\"text\">\n\n\t\t\t\t\t<nav class=\"controls\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Open in browser\")}\"\n\t\t\t\t\t\t\tclass=\"open-external-button icon\"><i class=\"codicon codicon-link-external\"></i></button>\n\t\t\t\t\t</nav>\n\t\t\t\t</header>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<div class=\"iframe-focused-alert\">${vscode.l10n.t(\"Focus Lock\")}</div>\n\t\t\t\t\t<iframe sandbox=\"allow-scripts allow-forms allow-same-origin allow-downloads\"></iframe>\n\t\t\t\t</div>\n\n\t\t\t\t<script src=\"${mainJs}\" nonce=\"${nonce}\"></script>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n\n\tprivate n(...parts: string[]): vscode.Uri {\n\t\treturn this.j.webview.asWebviewUri(vscode.Uri.joinPath(this.l, ...parts));\n\t}\n}\n\nfunction escapeAttribute(value: string | vscode.Uri): string {\n\treturn value.toString().replace(/\"/g, '&quot;');\n}\n\nfunction getNonce() {\n\tlet text = '';\n\tconst possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\tfor (let i = 0; i < 64; i++) {\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\t}\n\treturn text;\n}\n","module.exports = require(\"vscode\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { $d } from './simpleBrowserManager';\nimport { $c } from './simpleBrowserView';\n\ndeclare class URL {\n\tconstructor(input: string, base?: string | URL);\n\thostname: string;\n}\n\nconst openApiCommand = 'simpleBrowser.api.open';\nconst showCommand = 'simpleBrowser.show';\n\nconst enabledHosts = new Set<string>([\n\t'localhost',\n\t// localhost IPv4\n\t'127.0.0.1',\n\t// localhost IPv6\n\t'[0:0:0:0:0:0:0:1]',\n\t'[::1]',\n\t// all interfaces IPv4\n\t'0.0.0.0',\n\t// all interfaces IPv6\n\t'[0:0:0:0:0:0:0:0]',\n\t'[::]'\n]);\n\nconst openerId = 'simpleBrowser.open';\n\nexport function activate(context: vscode.ExtensionContext) {\n\n\tconst manager = new $d(context.extensionUri);\n\tcontext.subscriptions.push(manager);\n\n\tcontext.subscriptions.push(vscode.window.registerWebviewPanelSerializer($c.viewType, {\n\t\tdeserializeWebviewPanel: async (panel, state) => {\n\t\t\tmanager.restore(panel, state);\n\t\t}\n\t}));\n\n\tcontext.subscriptions.push(vscode.commands.registerCommand(showCommand, async (url?: string) => {\n\t\tif (!url) {\n\t\t\turl = await vscode.window.showInputBox({\n\t\t\t\tplaceHolder: vscode.l10n.t(\"https://example.com\"),\n\t\t\t\tprompt: vscode.l10n.t(\"Enter url to visit\")\n\t\t\t});\n\t\t}\n\n\t\tif (url) {\n\t\t\tmanager.show(url);\n\t\t}\n\t}));\n\n\tcontext.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: {\n\t\tpreserveFocus?: boolean;\n\t\tviewColumn: vscode.ViewColumn;\n\t}) => {\n\t\tmanager.show(url, showOptions);\n\t}));\n\n\tcontext.subscriptions.push(vscode.window.registerExternalUriOpener(openerId, {\n\t\tcanOpenExternalUri(uri: vscode.Uri) {\n\t\t\t// We have to replace the IPv6 hosts with IPv4 because URL can't handle IPv6.\n\t\t\tconst originalUri = new URL(uri.toString(true));\n\t\t\tif (enabledHosts.has(originalUri.hostname)) {\n\t\t\t\treturn isWeb()\n\t\t\t\t\t? vscode.ExternalUriOpenerPriority.Default\n\t\t\t\t\t: vscode.ExternalUriOpenerPriority.Option;\n\t\t\t}\n\n\t\t\treturn vscode.ExternalUriOpenerPriority.None;\n\t\t},\n\t\topenExternalUri(resolveUri: vscode.Uri) {\n\t\t\treturn manager.show(resolveUri, {\n\t\t\t\tviewColumn: vscode.window.activeTextEditor ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active\n\t\t\t});\n\t\t}\n\t}, {\n\t\tschemes: ['http', 'https'],\n\t\tlabel: vscode.l10n.t(\"Open in simple browser\"),\n\t}));\n}\n\nfunction isWeb(): boolean {\n\t// @ts-expect-error\n\treturn typeof navigator !== 'undefined' && vscode.env.uiKind === vscode.UIKind.Web;\n}\n"],"names":["$a","disposables","length","pop","dispose","a","b","this","c","value","push","constructor","undefined","show","inputUri","options","url","toString","view","$c","create","restore","panel","state","onDispose","$b","extensionUri","vscode","Uri","joinPath","enableScripts","enableForms","localResourceRoots","g","showOptions","webview","window","createWebviewPanel","viewType","f","viewColumn","ViewColumn","Active","preserveFocus","retainContextWhenHidden","h","webviewPanel","l","super","k","EventEmitter","event","j","onDidReceiveMessage","e","type","parse","env","openExternal","onDidDispose","workspace","onDidChangeConfiguration","affectsConfiguration","configuration","getConfiguration","postMessage","focusLockEnabled","get","fire","html","m","reveal","nonce","text","possible","i","charAt","Math","floor","random","getNonce","mainJs","n","mainCss","codiconsUri","cspSource","JSON","stringify","replace","l10n","t","parts","asWebviewUri","module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","enabledHosts","Set","context","manager","$d","subscriptions","registerWebviewPanelSerializer","deserializeWebviewPanel","async","commands","registerCommand","showInputBox","placeHolder","prompt","registerExternalUriOpener","canOpenExternalUri","uri","originalUri","URL","has","hostname","navigator","uiKind","UIKind","Web","ExternalUriOpenerPriority","Default","Option","None","openExternalUri","resolveUri","activeTextEditor","Beside","schemes","label"],"sourceRoot":""}
Binary file
@@ -0,0 +1 @@
1
+ function s(e){document.readyState==="loading"||document.readyState==="uninitialized"?document.addEventListener("DOMContentLoaded",e):e()}var d=acquireVsCodeApi();function i(){let e=document.getElementById("simple-browser-settings");if(e){let t=e.getAttribute("data-settings");if(t)return JSON.parse(t)}throw new Error("Could not load settings")}var r=i(),c=document.querySelector("iframe"),n=document.querySelector(".header"),a=n.querySelector(".url-input"),l=n.querySelector(".forward-button"),m=n.querySelector(".back-button"),g=n.querySelector(".reload-button"),E=n.querySelector(".open-external-button");window.addEventListener("message",e=>{switch(e.data.type){case"focus":{c.focus();break}case"didChangeFocusLockIndicatorEnabled":{u(e.data.enabled);break}}});s(()=>{setInterval(()=>{let t=document.activeElement?.tagName==="IFRAME";document.body.classList.toggle("iframe-focused",t)},50),c.addEventListener("load",()=>{}),a.addEventListener("change",t=>{let o=t.target.value;e(o)}),l.addEventListener("click",()=>{history.forward()}),m.addEventListener("click",()=>{history.back()}),E.addEventListener("click",()=>{d.postMessage({type:"openExternal",url:a.value})}),g.addEventListener("click",()=>{e(a.value)}),e(r.url),a.value=r.url,u(r.focusLockIndicatorEnabled);function e(t){try{let o=new URL(t);o.searchParams.append("vscodeBrowserReqId",Date.now().toString()),c.src=o.toString()}catch{c.src=t}d.setState({url:t})}});function u(e){document.body.classList.toggle("enable-focus-lock-indicator",e)}
@@ -0,0 +1 @@
1
+ {"name":"simple-browser","displayName":"%displayName%","description":"%description%","enabledApiProposals":["externalUriOpener"],"version":"1.0.0","icon":"media/icon.png","publisher":"vscode","license":"MIT","aiKey":"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255","engines":{"vscode":"^1.70.0"},"main":"./dist/extension","browser":"./dist/browser/extension","categories":["Other"],"extensionKind":["ui","workspace"],"activationEvents":["onCommand:simpleBrowser.api.open","onOpenExternalUri:http","onOpenExternalUri:https","onWebviewPanel:simpleBrowser.view"],"capabilities":{"virtualWorkspaces":true,"untrustedWorkspaces":{"supported":true}},"contributes":{"commands":[{"command":"simpleBrowser.show","title":"Show","category":"Simple Browser"}],"configuration":[{"title":"Simple Browser","properties":{"simpleBrowser.focusLockIndicator.enabled":{"type":"boolean","default":true,"title":"Focus Lock Indicator Enabled","description":"%configuration.focusLockIndicator.enabled.description%"}}}]},"repository":{"type":"git","url":"https://github.com/microsoft/vscode.git"}}
@@ -0,0 +1 @@
1
+ {"displayName":"Simple Browser","description":"A very basic built-in webview for displaying web content.","configuration.focusLockIndicator.enabled.description":"Enable/disable the floating indicator that shows when focused in the simple browser."}
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V13L2 14H14L15 13V3L14 2H2ZM2 13V3H14V13H2ZM12 5H4V6H12V5ZM3 4V7H13V4H3ZM7 9H3V8H7V9ZM3 12H7V11H3V12ZM12 9H10V11H12V9ZM9 8V12H13V8H9Z" fill="#C5C5C5"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V13L2 14H14L15 13V3L14 2H2ZM2 13V3H14V13H2ZM12 5H4V6H12V5ZM3 4V7H13V4H3ZM7 9H3V8H7V9ZM3 12H7V11H3V12ZM12 9H10V11H12V9ZM9 8V12H13V8H9Z" fill="#424242"/>
3
+ </svg>
package/extension.js DELETED
@@ -1,379 +0,0 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ var __webpack_modules__ = ([
4
- /* 0 */,
5
- /* 1 */
6
- /***/ ((module) => {
7
-
8
- module.exports = require("vscode");
9
-
10
- /***/ }),
11
- /* 2 */
12
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13
-
14
-
15
- /*---------------------------------------------------------------------------------------------
16
- * Copyright (c) Microsoft Corporation. All rights reserved.
17
- * Licensed under the MIT License. See License.txt in the project root for license information.
18
- *--------------------------------------------------------------------------------------------*/
19
- Object.defineProperty(exports, "__esModule", ({ value: true }));
20
- exports.SimpleBrowserManager = void 0;
21
- const simpleBrowserView_1 = __webpack_require__(3);
22
- class SimpleBrowserManager {
23
- constructor(extensionUri) {
24
- this.extensionUri = extensionUri;
25
- }
26
- dispose() {
27
- this._activeView?.dispose();
28
- this._activeView = undefined;
29
- }
30
- show(inputUri, options) {
31
- const url = typeof inputUri === 'string' ? inputUri : inputUri.toString(true);
32
- if (this._activeView) {
33
- this._activeView.show(url, options);
34
- }
35
- else {
36
- const view = simpleBrowserView_1.SimpleBrowserView.create(this.extensionUri, url, options);
37
- this.registerWebviewListeners(view);
38
- this._activeView = view;
39
- }
40
- }
41
- restore(panel, state) {
42
- const url = state?.url ?? '';
43
- const view = simpleBrowserView_1.SimpleBrowserView.restore(this.extensionUri, url, panel);
44
- this.registerWebviewListeners(view);
45
- this._activeView ?? (this._activeView = view);
46
- }
47
- registerWebviewListeners(view) {
48
- view.onDispose(() => {
49
- if (this._activeView === view) {
50
- this._activeView = undefined;
51
- }
52
- });
53
- }
54
- }
55
- exports.SimpleBrowserManager = SimpleBrowserManager;
56
-
57
-
58
- /***/ }),
59
- /* 3 */
60
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
61
-
62
-
63
- /*---------------------------------------------------------------------------------------------
64
- * Copyright (c) Microsoft Corporation. All rights reserved.
65
- * Licensed under the MIT License. See License.txt in the project root for license information.
66
- *--------------------------------------------------------------------------------------------*/
67
- Object.defineProperty(exports, "__esModule", ({ value: true }));
68
- exports.SimpleBrowserView = void 0;
69
- const vscode = __webpack_require__(1);
70
- const dispose_1 = __webpack_require__(4);
71
- class SimpleBrowserView extends dispose_1.Disposable {
72
- static getWebviewLocalResourceRoots(extensionUri) {
73
- return [
74
- vscode.Uri.joinPath(extensionUri, 'media')
75
- ];
76
- }
77
- static getWebviewOptions(extensionUri) {
78
- return {
79
- enableScripts: true,
80
- enableForms: true,
81
- localResourceRoots: SimpleBrowserView.getWebviewLocalResourceRoots(extensionUri),
82
- };
83
- }
84
- static create(extensionUri, url, showOptions) {
85
- const webview = vscode.window.createWebviewPanel(SimpleBrowserView.viewType, SimpleBrowserView.title, {
86
- viewColumn: showOptions?.viewColumn ?? vscode.ViewColumn.Active,
87
- preserveFocus: showOptions?.preserveFocus
88
- }, {
89
- retainContextWhenHidden: true,
90
- ...SimpleBrowserView.getWebviewOptions(extensionUri)
91
- });
92
- return new SimpleBrowserView(extensionUri, url, webview);
93
- }
94
- static restore(extensionUri, url, webviewPanel) {
95
- return new SimpleBrowserView(extensionUri, url, webviewPanel);
96
- }
97
- constructor(extensionUri, url, webviewPanel) {
98
- super();
99
- this.extensionUri = extensionUri;
100
- this._onDidDispose = this._register(new vscode.EventEmitter());
101
- this.onDispose = this._onDidDispose.event;
102
- this._webviewPanel = this._register(webviewPanel);
103
- this._webviewPanel.webview.options = SimpleBrowserView.getWebviewOptions(extensionUri);
104
- this._register(this._webviewPanel.webview.onDidReceiveMessage(e => {
105
- switch (e.type) {
106
- case 'openExternal':
107
- try {
108
- const url = vscode.Uri.parse(e.url);
109
- vscode.env.openExternal(url);
110
- }
111
- catch {
112
- // Noop
113
- }
114
- break;
115
- }
116
- }));
117
- this._register(this._webviewPanel.onDidDispose(() => {
118
- this.dispose();
119
- }));
120
- this._register(vscode.workspace.onDidChangeConfiguration(e => {
121
- if (e.affectsConfiguration('simpleBrowser.focusLockIndicator.enabled')) {
122
- const configuration = vscode.workspace.getConfiguration('simpleBrowser');
123
- this._webviewPanel.webview.postMessage({
124
- type: 'didChangeFocusLockIndicatorEnabled',
125
- focusLockEnabled: configuration.get('focusLockIndicator.enabled', true)
126
- });
127
- }
128
- }));
129
- this.show(url);
130
- }
131
- dispose() {
132
- this._onDidDispose.fire();
133
- super.dispose();
134
- }
135
- show(url, options) {
136
- this._webviewPanel.webview.html = this.getHtml(url);
137
- this._webviewPanel.reveal(options?.viewColumn, options?.preserveFocus);
138
- }
139
- getHtml(url) {
140
- const configuration = vscode.workspace.getConfiguration('simpleBrowser');
141
- const nonce = getNonce();
142
- const mainJs = this.extensionResourceUrl('media', 'index.js');
143
- const mainCss = this.extensionResourceUrl('media', 'main.css');
144
- const codiconsUri = this.extensionResourceUrl('media', 'codicon.css');
145
- return /* html */ `<!DOCTYPE html>
146
- <html>
147
- <head>
148
- <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
149
-
150
- <meta http-equiv="Content-Security-Policy" content="
151
- default-src 'none';
152
- font-src data:;
153
- style-src ${this._webviewPanel.webview.cspSource};
154
- script-src 'nonce-${nonce}';
155
- frame-src *;
156
- ">
157
-
158
- <meta id="simple-browser-settings" data-settings="${escapeAttribute(JSON.stringify({
159
- url: url,
160
- focusLockEnabled: configuration.get('focusLockIndicator.enabled', true)
161
- }))}">
162
-
163
- <link rel="stylesheet" type="text/css" href="${mainCss}">
164
- <link rel="stylesheet" type="text/css" href="${codiconsUri}">
165
- </head>
166
- <body>
167
- <header class="header">
168
- <nav class="controls">
169
- <button
170
- title="${vscode.l10n.t("Back")}"
171
- class="back-button icon"><i class="codicon codicon-arrow-left"></i></button>
172
-
173
- <button
174
- title="${vscode.l10n.t("Forward")}"
175
- class="forward-button icon"><i class="codicon codicon-arrow-right"></i></button>
176
-
177
- <button
178
- title="${vscode.l10n.t("Reload")}"
179
- class="reload-button icon"><i class="codicon codicon-refresh"></i></button>
180
- </nav>
181
-
182
- <input class="url-input" type="text">
183
-
184
- <nav class="controls">
185
- <button
186
- title="${vscode.l10n.t("Open in browser")}"
187
- class="open-external-button icon"><i class="codicon codicon-link-external"></i></button>
188
- </nav>
189
- </header>
190
- <div class="content">
191
- <div class="iframe-focused-alert">${vscode.l10n.t("Focus Lock")}</div>
192
- <iframe sandbox="allow-scripts allow-forms allow-same-origin allow-downloads"></iframe>
193
- </div>
194
-
195
- <script src="${mainJs}" nonce="${nonce}"></script>
196
- </body>
197
- </html>`;
198
- }
199
- extensionResourceUrl(...parts) {
200
- return this._webviewPanel.webview.asWebviewUri(vscode.Uri.joinPath(this.extensionUri, ...parts));
201
- }
202
- }
203
- exports.SimpleBrowserView = SimpleBrowserView;
204
- SimpleBrowserView.viewType = 'simpleBrowser.view';
205
- SimpleBrowserView.title = vscode.l10n.t("Simple Browser");
206
- function escapeAttribute(value) {
207
- return value.toString().replace(/"/g, '&quot;');
208
- }
209
- function getNonce() {
210
- let text = '';
211
- const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
212
- for (let i = 0; i < 64; i++) {
213
- text += possible.charAt(Math.floor(Math.random() * possible.length));
214
- }
215
- return text;
216
- }
217
-
218
-
219
- /***/ }),
220
- /* 4 */
221
- /***/ ((__unused_webpack_module, exports) => {
222
-
223
-
224
- /*---------------------------------------------------------------------------------------------
225
- * Copyright (c) Microsoft Corporation. All rights reserved.
226
- * Licensed under the MIT License. See License.txt in the project root for license information.
227
- *--------------------------------------------------------------------------------------------*/
228
- Object.defineProperty(exports, "__esModule", ({ value: true }));
229
- exports.Disposable = exports.disposeAll = void 0;
230
- function disposeAll(disposables) {
231
- while (disposables.length) {
232
- const item = disposables.pop();
233
- item?.dispose();
234
- }
235
- }
236
- exports.disposeAll = disposeAll;
237
- class Disposable {
238
- constructor() {
239
- this._isDisposed = false;
240
- this._disposables = [];
241
- }
242
- dispose() {
243
- if (this._isDisposed) {
244
- return;
245
- }
246
- this._isDisposed = true;
247
- disposeAll(this._disposables);
248
- }
249
- _register(value) {
250
- if (this._isDisposed) {
251
- value.dispose();
252
- }
253
- else {
254
- this._disposables.push(value);
255
- }
256
- return value;
257
- }
258
- get isDisposed() {
259
- return this._isDisposed;
260
- }
261
- }
262
- exports.Disposable = Disposable;
263
-
264
-
265
- /***/ })
266
- /******/ ]);
267
- /************************************************************************/
268
- /******/ // The module cache
269
- /******/ var __webpack_module_cache__ = {};
270
- /******/
271
- /******/ // The require function
272
- /******/ function __webpack_require__(moduleId) {
273
- /******/ // Check if module is in cache
274
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
275
- /******/ if (cachedModule !== undefined) {
276
- /******/ return cachedModule.exports;
277
- /******/ }
278
- /******/ // Create a new module (and put it into the cache)
279
- /******/ var module = __webpack_module_cache__[moduleId] = {
280
- /******/ // no module.id needed
281
- /******/ // no module.loaded needed
282
- /******/ exports: {}
283
- /******/ };
284
- /******/
285
- /******/ // Execute the module function
286
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
287
- /******/
288
- /******/ // Return the exports of the module
289
- /******/ return module.exports;
290
- /******/ }
291
- /******/
292
- /************************************************************************/
293
- var __webpack_exports__ = {};
294
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
295
- (() => {
296
- var exports = __webpack_exports__;
297
-
298
- /*---------------------------------------------------------------------------------------------
299
- * Copyright (c) Microsoft Corporation. All rights reserved.
300
- * Licensed under the MIT License. See License.txt in the project root for license information.
301
- *--------------------------------------------------------------------------------------------*/
302
- Object.defineProperty(exports, "__esModule", ({ value: true }));
303
- exports.activate = void 0;
304
- const vscode = __webpack_require__(1);
305
- const simpleBrowserManager_1 = __webpack_require__(2);
306
- const simpleBrowserView_1 = __webpack_require__(3);
307
- const openApiCommand = 'simpleBrowser.api.open';
308
- const showCommand = 'simpleBrowser.show';
309
- const enabledHosts = new Set([
310
- 'localhost',
311
- // localhost IPv4
312
- '127.0.0.1',
313
- // localhost IPv6
314
- '[0:0:0:0:0:0:0:1]',
315
- '[::1]',
316
- // all interfaces IPv4
317
- '0.0.0.0',
318
- // all interfaces IPv6
319
- '[0:0:0:0:0:0:0:0]',
320
- '[::]'
321
- ]);
322
- const openerId = 'simpleBrowser.open';
323
- function activate(context) {
324
- const manager = new simpleBrowserManager_1.SimpleBrowserManager(context.extensionUri);
325
- context.subscriptions.push(manager);
326
- context.subscriptions.push(vscode.window.registerWebviewPanelSerializer(simpleBrowserView_1.SimpleBrowserView.viewType, {
327
- deserializeWebviewPanel: async (panel, state) => {
328
- manager.restore(panel, state);
329
- }
330
- }));
331
- context.subscriptions.push(vscode.commands.registerCommand(showCommand, async (url) => {
332
- if (!url) {
333
- url = await vscode.window.showInputBox({
334
- placeHolder: vscode.l10n.t("https://example.com"),
335
- prompt: vscode.l10n.t("Enter url to visit")
336
- });
337
- }
338
- if (url) {
339
- manager.show(url);
340
- }
341
- }));
342
- context.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url, showOptions) => {
343
- manager.show(url, showOptions);
344
- }));
345
- context.subscriptions.push(vscode.window.registerExternalUriOpener(openerId, {
346
- canOpenExternalUri(uri) {
347
- // We have to replace the IPv6 hosts with IPv4 because URL can't handle IPv6.
348
- const originalUri = new URL(uri.toString(true));
349
- if (enabledHosts.has(originalUri.hostname)) {
350
- return isWeb()
351
- ? vscode.ExternalUriOpenerPriority.Default
352
- : vscode.ExternalUriOpenerPriority.Option;
353
- }
354
- return vscode.ExternalUriOpenerPriority.None;
355
- },
356
- openExternalUri(resolveUri) {
357
- return manager.show(resolveUri, {
358
- viewColumn: vscode.window.activeTextEditor ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active
359
- });
360
- }
361
- }, {
362
- schemes: ['http', 'https'],
363
- label: vscode.l10n.t("Open in simple browser"),
364
- }));
365
- }
366
- exports.activate = activate;
367
- function isWeb() {
368
- // @ts-expect-error
369
- return typeof navigator !== 'undefined' && vscode.env.uiKind === vscode.UIKind.Web;
370
- }
371
-
372
- })();
373
-
374
- var __webpack_export_target__ = exports;
375
- for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
376
- if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
377
- /******/ })()
378
- ;
379
- //# sourceMappingURL=extension.js.map
package/extension.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","mappings":";;;;;;;AAAA;;;;;;;ACAA;;;gGAGgG;;;AAGhG,mDAAqE;AAErE,MAAa,oBAAoB;IAIhC,YACkB,YAAwB;QAAxB,iBAAY,GAAZ,YAAY,CAAY;IACtC,CAAC;IAEL,OAAO;QACN,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC9B,CAAC;IAEM,IAAI,CAAC,QAA6B,EAAE,OAAqB;QAC/D,MAAM,GAAG,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CA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CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,OAAO;oBAC1C,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,MAAM,CAAC;YAC5C,CAAC;YAED,OAAO,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC;QAC9C,CAAC;QACD,eAAe,CAAC,UAAsB;YACrC,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE;gBAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;aAChG,CAAC,CAAC;QACJ,CAAC;KACD,EAAE;QACF,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC;KAC9C,CAAC,CAAC,CAAC;AACL,CAAC;AApDD,4BAoDC;AAED,SAAS,KAAK;IACb,mBAAmB;IACnB,OAAO,OAAO,SAAS,KAAK,WAAW,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;AACpF,CAAC","sources":["webpack://simple-browser/external commonjs \"vscode\"","webpack://simple-browser/./src/simpleBrowserManager.ts","webpack://simple-browser/./src/simpleBrowserView.ts","webpack://simple-browser/./src/dispose.ts","webpack://simple-browser/webpack/bootstrap","webpack://simple-browser/./src/extension.ts"],"sourcesContent":["module.exports = require(\"vscode\");","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { ShowOptions, SimpleBrowserView } from './simpleBrowserView';\n\nexport class SimpleBrowserManager {\n\n\tprivate _activeView?: SimpleBrowserView;\n\n\tconstructor(\n\t\tprivate readonly extensionUri: vscode.Uri,\n\t) { }\n\n\tdispose() {\n\t\tthis._activeView?.dispose();\n\t\tthis._activeView = undefined;\n\t}\n\n\tpublic show(inputUri: string | vscode.Uri, options?: ShowOptions): void {\n\t\tconst url = typeof inputUri === 'string' ? inputUri : inputUri.toString(true);\n\t\tif (this._activeView) {\n\t\t\tthis._activeView.show(url, options);\n\t\t} else {\n\t\t\tconst view = SimpleBrowserView.create(this.extensionUri, url, options);\n\t\t\tthis.registerWebviewListeners(view);\n\n\t\t\tthis._activeView = view;\n\t\t}\n\t}\n\n\tpublic restore(panel: vscode.WebviewPanel, state: any): void {\n\t\tconst url = state?.url ?? '';\n\t\tconst view = SimpleBrowserView.restore(this.extensionUri, url, panel);\n\t\tthis.registerWebviewListeners(view);\n\t\tthis._activeView ??= view;\n\t}\n\n\tprivate registerWebviewListeners(view: SimpleBrowserView) {\n\t\tview.onDispose(() => {\n\t\t\tif (this._activeView === view) {\n\t\t\t\tthis._activeView = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { Disposable } from './dispose';\n\n\nexport interface ShowOptions {\n\treadonly preserveFocus?: boolean;\n\treadonly viewColumn?: vscode.ViewColumn;\n}\n\nexport class SimpleBrowserView extends Disposable {\n\n\tpublic static readonly viewType = 'simpleBrowser.view';\n\tprivate static readonly title = vscode.l10n.t(\"Simple Browser\");\n\n\tprivate static getWebviewLocalResourceRoots(extensionUri: vscode.Uri): readonly vscode.Uri[] {\n\t\treturn [\n\t\t\tvscode.Uri.joinPath(extensionUri, 'media')\n\t\t];\n\t}\n\n\tprivate static getWebviewOptions(extensionUri: vscode.Uri): vscode.WebviewOptions {\n\t\treturn {\n\t\t\tenableScripts: true,\n\t\t\tenableForms: true,\n\t\t\tlocalResourceRoots: SimpleBrowserView.getWebviewLocalResourceRoots(extensionUri),\n\t\t};\n\t}\n\n\tprivate readonly _webviewPanel: vscode.WebviewPanel;\n\n\tprivate readonly _onDidDispose = this._register(new vscode.EventEmitter<void>());\n\tpublic readonly onDispose = this._onDidDispose.event;\n\n\tpublic static create(\n\t\textensionUri: vscode.Uri,\n\t\turl: string,\n\t\tshowOptions?: ShowOptions\n\t): SimpleBrowserView {\n\t\tconst webview = vscode.window.createWebviewPanel(SimpleBrowserView.viewType, SimpleBrowserView.title, {\n\t\t\tviewColumn: showOptions?.viewColumn ?? vscode.ViewColumn.Active,\n\t\t\tpreserveFocus: showOptions?.preserveFocus\n\t\t}, {\n\t\t\tretainContextWhenHidden: true,\n\t\t\t...SimpleBrowserView.getWebviewOptions(extensionUri)\n\t\t});\n\t\treturn new SimpleBrowserView(extensionUri, url, webview);\n\t}\n\n\tpublic static restore(\n\t\textensionUri: vscode.Uri,\n\t\turl: string,\n\t\twebviewPanel: vscode.WebviewPanel,\n\t): SimpleBrowserView {\n\t\treturn new SimpleBrowserView(extensionUri, url, webviewPanel);\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly extensionUri: vscode.Uri,\n\t\turl: string,\n\t\twebviewPanel: vscode.WebviewPanel,\n\t) {\n\t\tsuper();\n\n\t\tthis._webviewPanel = this._register(webviewPanel);\n\t\tthis._webviewPanel.webview.options = SimpleBrowserView.getWebviewOptions(extensionUri);\n\n\t\tthis._register(this._webviewPanel.webview.onDidReceiveMessage(e => {\n\t\t\tswitch (e.type) {\n\t\t\t\tcase 'openExternal':\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst url = vscode.Uri.parse(e.url);\n\t\t\t\t\t\tvscode.env.openExternal(url);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Noop\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._webviewPanel.onDidDispose(() => {\n\t\t\tthis.dispose();\n\t\t}));\n\n\t\tthis._register(vscode.workspace.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration('simpleBrowser.focusLockIndicator.enabled')) {\n\t\t\t\tconst configuration = vscode.workspace.getConfiguration('simpleBrowser');\n\t\t\t\tthis._webviewPanel.webview.postMessage({\n\t\t\t\t\ttype: 'didChangeFocusLockIndicatorEnabled',\n\t\t\t\t\tfocusLockEnabled: configuration.get<boolean>('focusLockIndicator.enabled', true)\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis.show(url);\n\t}\n\n\tpublic override dispose() {\n\t\tthis._onDidDispose.fire();\n\t\tsuper.dispose();\n\t}\n\n\tpublic show(url: string, options?: ShowOptions) {\n\t\tthis._webviewPanel.webview.html = this.getHtml(url);\n\t\tthis._webviewPanel.reveal(options?.viewColumn, options?.preserveFocus);\n\t}\n\n\tprivate getHtml(url: string) {\n\t\tconst configuration = vscode.workspace.getConfiguration('simpleBrowser');\n\n\t\tconst nonce = getNonce();\n\n\t\tconst mainJs = this.extensionResourceUrl('media', 'index.js');\n\t\tconst mainCss = this.extensionResourceUrl('media', 'main.css');\n\t\tconst codiconsUri = this.extensionResourceUrl('media', 'codicon.css');\n\n\t\treturn /* html */ `<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t\t<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\">\n\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"\n\t\t\t\t\tdefault-src 'none';\n\t\t\t\t\tfont-src data:;\n\t\t\t\t\tstyle-src ${this._webviewPanel.webview.cspSource};\n\t\t\t\t\tscript-src 'nonce-${nonce}';\n\t\t\t\t\tframe-src *;\n\t\t\t\t\t\">\n\n\t\t\t\t<meta id=\"simple-browser-settings\" data-settings=\"${escapeAttribute(JSON.stringify({\n\t\t\turl: url,\n\t\t\tfocusLockEnabled: configuration.get<boolean>('focusLockIndicator.enabled', true)\n\t\t}))}\">\n\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${mainCss}\">\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${codiconsUri}\">\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<header class=\"header\">\n\t\t\t\t\t<nav class=\"controls\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Back\")}\"\n\t\t\t\t\t\t\tclass=\"back-button icon\"><i class=\"codicon codicon-arrow-left\"></i></button>\n\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Forward\")}\"\n\t\t\t\t\t\t\tclass=\"forward-button icon\"><i class=\"codicon codicon-arrow-right\"></i></button>\n\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Reload\")}\"\n\t\t\t\t\t\t\tclass=\"reload-button icon\"><i class=\"codicon codicon-refresh\"></i></button>\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t<input class=\"url-input\" type=\"text\">\n\n\t\t\t\t\t<nav class=\"controls\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle=\"${vscode.l10n.t(\"Open in browser\")}\"\n\t\t\t\t\t\t\tclass=\"open-external-button icon\"><i class=\"codicon codicon-link-external\"></i></button>\n\t\t\t\t\t</nav>\n\t\t\t\t</header>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<div class=\"iframe-focused-alert\">${vscode.l10n.t(\"Focus Lock\")}</div>\n\t\t\t\t\t<iframe sandbox=\"allow-scripts allow-forms allow-same-origin allow-downloads\"></iframe>\n\t\t\t\t</div>\n\n\t\t\t\t<script src=\"${mainJs}\" nonce=\"${nonce}\"></script>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n\n\tprivate extensionResourceUrl(...parts: string[]): vscode.Uri {\n\t\treturn this._webviewPanel.webview.asWebviewUri(vscode.Uri.joinPath(this.extensionUri, ...parts));\n\t}\n}\n\nfunction escapeAttribute(value: string | vscode.Uri): string {\n\treturn value.toString().replace(/\"/g, '&quot;');\n}\n\nfunction getNonce() {\n\tlet text = '';\n\tconst possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\tfor (let i = 0; i < 64; i++) {\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\t}\n\treturn text;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\n\nexport function disposeAll(disposables: vscode.Disposable[]) {\n\twhile (disposables.length) {\n\t\tconst item = disposables.pop();\n\t\titem?.dispose();\n\t}\n}\n\nexport abstract class Disposable {\n\tprivate _isDisposed = false;\n\n\tprotected _disposables: vscode.Disposable[] = [];\n\n\tpublic dispose(): any {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tdisposeAll(this._disposables);\n\t}\n\n\tprotected _register<T extends vscode.Disposable>(value: T): T {\n\t\tif (this._isDisposed) {\n\t\t\tvalue.dispose();\n\t\t} else {\n\t\t\tthis._disposables.push(value);\n\t\t}\n\t\treturn value;\n\t}\n\n\tprotected get isDisposed() {\n\t\treturn this._isDisposed;\n\t}\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\nimport { SimpleBrowserManager } from './simpleBrowserManager';\nimport { SimpleBrowserView } from './simpleBrowserView';\n\ndeclare class URL {\n\tconstructor(input: string, base?: string | URL);\n\thostname: string;\n}\n\nconst openApiCommand = 'simpleBrowser.api.open';\nconst showCommand = 'simpleBrowser.show';\n\nconst enabledHosts = new Set<string>([\n\t'localhost',\n\t// localhost IPv4\n\t'127.0.0.1',\n\t// localhost IPv6\n\t'[0:0:0:0:0:0:0:1]',\n\t'[::1]',\n\t// all interfaces IPv4\n\t'0.0.0.0',\n\t// all interfaces IPv6\n\t'[0:0:0:0:0:0:0:0]',\n\t'[::]'\n]);\n\nconst openerId = 'simpleBrowser.open';\n\nexport function activate(context: vscode.ExtensionContext) {\n\n\tconst manager = new SimpleBrowserManager(context.extensionUri);\n\tcontext.subscriptions.push(manager);\n\n\tcontext.subscriptions.push(vscode.window.registerWebviewPanelSerializer(SimpleBrowserView.viewType, {\n\t\tdeserializeWebviewPanel: async (panel, state) => {\n\t\t\tmanager.restore(panel, state);\n\t\t}\n\t}));\n\n\tcontext.subscriptions.push(vscode.commands.registerCommand(showCommand, async (url?: string) => {\n\t\tif (!url) {\n\t\t\turl = await vscode.window.showInputBox({\n\t\t\t\tplaceHolder: vscode.l10n.t(\"https://example.com\"),\n\t\t\t\tprompt: vscode.l10n.t(\"Enter url to visit\")\n\t\t\t});\n\t\t}\n\n\t\tif (url) {\n\t\t\tmanager.show(url);\n\t\t}\n\t}));\n\n\tcontext.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: {\n\t\tpreserveFocus?: boolean;\n\t\tviewColumn: vscode.ViewColumn;\n\t}) => {\n\t\tmanager.show(url, showOptions);\n\t}));\n\n\tcontext.subscriptions.push(vscode.window.registerExternalUriOpener(openerId, {\n\t\tcanOpenExternalUri(uri: vscode.Uri) {\n\t\t\t// We have to replace the IPv6 hosts with IPv4 because URL can't handle IPv6.\n\t\t\tconst originalUri = new URL(uri.toString(true));\n\t\t\tif (enabledHosts.has(originalUri.hostname)) {\n\t\t\t\treturn isWeb()\n\t\t\t\t\t? vscode.ExternalUriOpenerPriority.Default\n\t\t\t\t\t: vscode.ExternalUriOpenerPriority.Option;\n\t\t\t}\n\n\t\t\treturn vscode.ExternalUriOpenerPriority.None;\n\t\t},\n\t\topenExternalUri(resolveUri: vscode.Uri) {\n\t\t\treturn manager.show(resolveUri, {\n\t\t\t\tviewColumn: vscode.window.activeTextEditor ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active\n\t\t\t});\n\t\t}\n\t}, {\n\t\tschemes: ['http', 'https'],\n\t\tlabel: vscode.l10n.t(\"Open in simple browser\"),\n\t}));\n}\n\nfunction isWeb(): boolean {\n\t// @ts-expect-error\n\treturn typeof navigator !== 'undefined' && vscode.env.uiKind === vscode.UIKind.Web;\n}\n"],"names":[],"sourceRoot":""}
package/index2.js DELETED
@@ -1,14 +0,0 @@
1
- import { registerExtension } from 'vscode/extensions';
2
-
3
- var manifest = {name:"simple-browser",displayName:"%displayName%",description:"%description%",enabledApiProposals:["externalUriOpener"],version:"1.0.0",icon:"media/icon.png",publisher:"vscode",license:"MIT",aiKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",engines:{vscode:"^1.70.0"},main:undefined,browser:"./dist/browser/extension",categories:["Other"],extensionKind:["ui","workspace"],activationEvents:["onCommand:simpleBrowser.api.open","onOpenExternalUri:http","onOpenExternalUri:https","onWebviewPanel:simpleBrowser.view"],capabilities:{virtualWorkspaces:true,untrustedWorkspaces:{supported:true}},contributes:{commands:[{command:"simpleBrowser.show",title:"Show",category:"Simple Browser"}],configuration:[{title:"Simple Browser",properties:{"simpleBrowser.focusLockIndicator.enabled":{type:"boolean","default":true,title:"Focus Lock Indicator Enabled",description:"%configuration.focusLockIndicator.enabled.description%"}}}]},scripts:{compile:"gulp compile-extension:markdown-language-features && npm run build-preview",watch:"npm run build-preview && gulp watch-extension:markdown-language-features","vscode:prepublish":"npm run build-ext && npm run build-preview","build-ext":"node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json","build-preview":"node ./esbuild-preview","compile-web":"npx webpack-cli --config extension-browser.webpack.config --mode none","watch-web":"npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"},dependencies:{"@vscode/extension-telemetry":"^0.9.0"},devDependencies:{"@types/vscode-webview":"^1.57.0","vscode-codicons":"^0.0.14"},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
4
-
5
- const { registerFileUrl, whenReady } = registerExtension(manifest);
6
- registerFileUrl('./dist/browser/extension', new URL('./extension.js', import.meta.url).toString(), 'text/javascript');
7
- registerFileUrl('./dist/browser/extension.js', new URL('./extension.js', import.meta.url).toString(), 'text/javascript');
8
- registerFileUrl('dist/browser/extension.js.map', new URL('./extension.js.map', import.meta.url).toString(), 'application/json');
9
- registerFileUrl('./media/index.js', new URL('./index.js', import.meta.url).toString(), 'application/javascript');
10
- registerFileUrl('./media/main.css', new URL('./main.css', import.meta.url).toString(), 'text/css');
11
- registerFileUrl('./media/codicon.css', new URL('./codicon.css', import.meta.url).toString(), 'text/css');
12
- registerFileUrl('package.nls.json', new URL('./package.nls.json', import.meta.url).toString(), 'application/json');
13
-
14
- export { whenReady };
package/package.nls.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "displayName": "Simple Browser",
3
- "description": "A very basic built-in webview for displaying web content.",
4
- "configuration.focusLockIndicator.enabled.description": "Enable/disable the floating indicator that shows when focused in the simple browser."
5
- }
File without changes
File without changes