-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from JonnyBurger/puppeteer-support
- Loading branch information
Showing
21 changed files
with
7,942 additions
and
13,485 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export type BrowserExecutable = string | null; | ||
|
||
let currentBrowserExecutablePath: BrowserExecutable = null; | ||
|
||
export const setBrowserExecutable = ( | ||
newBrowserExecutablePath: BrowserExecutable | ||
) => { | ||
currentBrowserExecutablePath = newBrowserExecutablePath; | ||
}; | ||
|
||
export const getBrowserExecutable = () => { | ||
return currentBrowserExecutablePath; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export type Browser = 'chrome' | 'firefox'; | ||
|
||
export const DEFAULT_BROWSER: Browser = 'chrome'; | ||
|
||
// There is no Firefox support yet, the waitForFunction method | ||
// does not yet work and downloading has a bug. | ||
// Disabling this for now! | ||
export const FEATURE_FLAG_FIREFOX_SUPPORT = false; | ||
|
||
let currentBrowser: Browser | null = null; | ||
|
||
export const setBrowser = (browser: Browser) => { | ||
if (browser === 'chrome') { | ||
process.env.PUPPETEER_PRODUCT = 'chrome'; | ||
} | ||
if (browser === 'firefox') { | ||
process.env.PUPPETEER_PRODUCT = 'firefox'; | ||
} | ||
currentBrowser = browser; | ||
}; | ||
|
||
export const getBrowser = () => { | ||
return currentBrowser; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.