File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import fs from "node:fs" ;
22import libpath from "node:path" ;
3+ import path from "node:path" ;
4+ import { fileURLToPath } from "node:url" ;
35import type { Page } from "puppeteer" ;
46import {
57 DEFAULT_ACCEPTED_EVENT_NAMES ,
68 DEFAULT_ACCEPTED_TAG_NAMES ,
79} from "../constants.js" ;
810import type { Adapter , Device , TappableElement } from "../types.js" ;
911
12+ const __filename = fileURLToPath ( import . meta. url ) ;
13+ const __dirname = path . dirname ( __filename ) ;
14+
1015export class PuppeteerAdapter implements Adapter {
1116 private page : Page ;
1217
@@ -69,7 +74,7 @@ export class PuppeteerAdapter implements Adapter {
6974 ) ;
7075
7176 const detector = fs
72- . readFileSync ( libpath . join ( process . cwd ( ) , "src /browser/detector.js" ) , {
77+ . readFileSync ( libpath . join ( __dirname , ".. /browser/detector.js" ) , {
7378 encoding : "utf-8" ,
7479 } )
7580 . replace ( '"{{arg0}}"' , JSON . stringify ( DEFAULT_ACCEPTED_TAG_NAMES ) )
You can’t perform that action at this time.
0 commit comments