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';
10
10
import { getAvailableBrowsers , launchBrowser , BrowserInstance } from '../browsers' ;
11
11
import { delay } from '../util' ;
12
12
import { HideChromeWarningServer } from '../hide-chrome-warning-server' ;
13
+ import { Interceptor } from '.' ;
13
14
14
15
const readFile = promisify ( fs . readFile ) ;
15
16
@@ -25,7 +26,7 @@ const getChromeBrowserName = async (config: HtkConfig): Promise<string | undefin
25
26
. value ( ) [ 0 ] ;
26
27
} ;
27
28
28
- export class FreshChrome {
29
+ export class FreshChrome implements Interceptor {
29
30
id = 'fresh-chrome' ;
30
31
version = '1.0.0' ;
31
32
@@ -42,7 +43,7 @@ export class FreshChrome {
42
43
async activate ( proxyPort : number ) {
43
44
if ( this . isActive ( proxyPort ) ) return ;
44
45
45
- const certificatePem = await readFile ( path . join ( this . config . configPath , 'ca.pem' ) , 'utf8' ) ;
46
+ const certificatePem = await readFile ( this . config . https . certPath , 'utf8' ) ;
46
47
const spkiFingerprint = generateSPKIFingerprint ( certificatePem ) ;
47
48
48
49
const hideWarningServer = new HideChromeWarningServer ( ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { HtkConfig } from '../config';
9
9
import { getAvailableBrowsers , launchBrowser , BrowserInstance } from '../browsers' ;
10
10
import { CertCheckServer } from '../cert-check-server' ;
11
11
import { delay } from '../util' ;
12
+ import { Interceptor } from '.' ;
12
13
13
14
const deleteFolder = promisify ( rimraf ) ;
14
15
const readFile = promisify ( fs . readFile ) ;
@@ -21,7 +22,7 @@ const FIREFOX_PREF_REGEX = /\w+_pref\("([^"]+)", (.*)\);/
21
22
22
23
let browsers : _ . Dictionary < BrowserInstance > = { } ;
23
24
24
- export class FreshFirefox {
25
+ export class FreshFirefox implements Interceptor {
25
26
id = 'fresh-firefox' ;
26
27
version = '1.0.0' ;
27
28
@@ -32,9 +33,9 @@ export class FreshFirefox {
32
33
}
33
34
34
35
async isActivable ( ) {
35
- const browsers = await getAvailableBrowsers ( this . config . configPath ) ;
36
+ const availableBrowsers = await getAvailableBrowsers ( this . config . configPath ) ;
36
37
37
- return _ ( browsers )
38
+ return _ ( availableBrowsers )
38
39
. map ( b => b . name )
39
40
. includes ( 'firefox' )
40
41
You can’t perform that action at this time.
0 commit comments