File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ import prompt from "dialogs/prompt" ;
12import fsOperation from "fileSystem" ;
23import actions from "handlers/quickTools" ;
34import keyBindings from "lib/keyBindings" ;
@@ -119,6 +120,19 @@ const commands = [
119120 } ,
120121 readOnly : true ,
121122 } ,
123+ {
124+ name : "openInAppBrowser" ,
125+ description : "Open In-App Browser" ,
126+ async exec ( ) {
127+ const url = await prompt ( "Enter url" , "" , "url" , {
128+ placeholder : "http://" ,
129+ match : / ^ h t t p s ? : \/ \/ .+ / ,
130+ } ) ;
131+ if ( url ) {
132+ acode . exec ( "open-inapp-browser" , url ) ;
133+ }
134+ } ,
135+ } ,
122136 {
123137 name : "toggleFullscreen" ,
124138 description : "Toggle full screen mode" ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import changeEncoding from "palettes/changeEncoding";
1313import changeMode from "palettes/changeMode" ;
1414import commandPalette from "palettes/commandPalette" ;
1515import findFile from "palettes/findFile" ;
16+ import browser from "plugins/browser" ;
1617import help from "settings/helpSettings" ;
1718import mainSettings from "settings/mainSettings" ;
1819import Url from "utils/Url" ;
@@ -236,7 +237,9 @@ export default {
236237 "resize-editor" ( ) {
237238 editorManager . editor . resize ( true ) ;
238239 } ,
239-
240+ "open-inapp-browser" ( url ) {
241+ browser . open ( url ) ;
242+ } ,
240243 run ( ) {
241244 editorManager . activeFile [
242245 appSettings . value . useCurrentFileForPreview ? "runFile" : "run"
You can’t perform that action at this time.
0 commit comments