File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { HtkConfig } from '../config';
1010import { getAvailableBrowsers , launchBrowser , BrowserInstance } from '../browsers' ;
1111import { delay } from '../util' ;
1212import { HideChromeWarningServer } from '../hide-chrome-warning-server' ;
13+ import { Interceptor } from '.' ;
1314
1415const readFile = promisify ( fs . readFile ) ;
1516
@@ -25,7 +26,7 @@ const getChromeBrowserName = async (config: HtkConfig): Promise<string | undefin
2526 . value ( ) [ 0 ] ;
2627} ;
2728
28- export class FreshChrome {
29+ export class FreshChrome implements Interceptor {
2930 id = 'fresh-chrome' ;
3031 version = '1.0.0' ;
3132
@@ -42,7 +43,7 @@ export class FreshChrome {
4243 async activate ( proxyPort : number ) {
4344 if ( this . isActive ( proxyPort ) ) return ;
4445
45- const certificatePem = await readFile ( path . join ( this . config . configPath , 'ca.pem' ) , 'utf8' ) ;
46+ const certificatePem = await readFile ( this . config . https . certPath , 'utf8' ) ;
4647 const spkiFingerprint = generateSPKIFingerprint ( certificatePem ) ;
4748
4849 const hideWarningServer = new HideChromeWarningServer ( ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { HtkConfig } from '../config';
99import { getAvailableBrowsers , launchBrowser , BrowserInstance } from '../browsers' ;
1010import { CertCheckServer } from '../cert-check-server' ;
1111import { delay } from '../util' ;
12+ import { Interceptor } from '.' ;
1213
1314const deleteFolder = promisify ( rimraf ) ;
1415const readFile = promisify ( fs . readFile ) ;
@@ -21,7 +22,7 @@ const FIREFOX_PREF_REGEX = /\w+_pref\("([^"]+)", (.*)\);/
2122
2223let browsers : _ . Dictionary < BrowserInstance > = { } ;
2324
24- export class FreshFirefox {
25+ export class FreshFirefox implements Interceptor {
2526 id = 'fresh-firefox' ;
2627 version = '1.0.0' ;
2728
@@ -32,9 +33,9 @@ export class FreshFirefox {
3233 }
3334
3435 async isActivable ( ) {
35- const browsers = await getAvailableBrowsers ( this . config . configPath ) ;
36+ const availableBrowsers = await getAvailableBrowsers ( this . config . configPath ) ;
3637
37- return _ ( browsers )
38+ return _ ( availableBrowsers )
3839 . map ( b => b . name )
3940 . includes ( 'firefox' )
4041
You can’t perform that action at this time.
0 commit comments