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) {
103
103
console . log ( 'Not the main instance - quitting' ) ;
104
104
app . quit ( ) ;
105
105
} 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
+
106
118
app . on ( 'ready' , ( ) => {
107
119
Menu . setApplicationMenu ( menu ) ;
108
120
} ) ;
@@ -180,6 +192,8 @@ if (!amMainInstance) {
180
192
// gets replaced on first navigation (immediately), whilst global
181
193
// vars like this are forever.
182
194
injectValue ( 'httpToolkitAuthToken' , AUTH_TOKEN ) ;
195
+
196
+ if ( forwardingUrl ) injectValue ( 'httpToolkitForwardingDefault' , forwardingUrl ) ;
183
197
} ) ;
184
198
185
199
// Redirect all navigations & new windows to the system browser
You can’t perform that action at this time.
0 commit comments