File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,18 @@ if (!amMainInstance) {
103103 console . log ( 'Not the main instance - quitting' ) ;
104104 app . quit ( ) ;
105105} else {
106+ const cliArgs = process . argv . slice ( 1 ) ;
107+
108+ let forwardingUrl : string | undefined = undefined ;
109+ if ( cliArgs [ 0 ] === '--with-forwarding' ) {
110+ if ( ! cliArgs [ 1 ] || ! cliArgs [ 1 ] . includes ( '|' ) || cliArgs [ 1 ] . match ( / ' " \n / ) ) {
111+ console . error ( 'Invalid --with-forwarding argument' ) ;
112+ process . exit ( 1 ) ; // Safe to hard exit - we haven't opened/started anything yet.
113+ } else {
114+ forwardingUrl = cliArgs [ 1 ] ;
115+ }
116+ }
117+
106118 app . on ( 'ready' , ( ) => {
107119 Menu . setApplicationMenu ( menu ) ;
108120 } ) ;
@@ -180,6 +192,8 @@ if (!amMainInstance) {
180192 // gets replaced on first navigation (immediately), whilst global
181193 // vars like this are forever.
182194 injectValue ( 'httpToolkitAuthToken' , AUTH_TOKEN ) ;
195+
196+ if ( forwardingUrl ) injectValue ( 'httpToolkitForwardingDefault' , forwardingUrl ) ;
183197 } ) ;
184198
185199 // Redirect all navigations & new windows to the system browser
You can’t perform that action at this time.
0 commit comments