-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update devtools-extensions build script to reflect changes in local b… #21004
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,32 @@ const {argv} = require('yargs'); | |
const EXTENSION_PATH = resolve('./firefox/build/unpacked'); | ||
const START_URL = argv.url || 'https://reactjs.org/'; | ||
|
||
const ffVersion = process.env.WEB_EXT_FIREFOX; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit I generally like to avoid abbreviations in variable names like "ff". Totally not a big deal given the context of this change, but for consistency elsewhere I might rename this one before merging. |
||
|
||
const getFFProfileName = () => { | ||
// Keys are pulled from https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#--firefox | ||
// and profile names from https://searchfox.org/mozilla-central/source/toolkit/profile/xpcshell/head.js#96 | ||
switch (ffVersion) { | ||
case 'firefox': | ||
return 'default-release'; | ||
case 'beta': | ||
return 'default-beta'; | ||
case 'nightly': | ||
return 'default-nightly'; | ||
case 'firefoxdeveloperedition': | ||
return 'dev-edition-default'; | ||
default: | ||
return 'default'; | ||
} | ||
}; | ||
|
||
const main = async () => { | ||
const finder = new Finder(); | ||
|
||
// Use default Firefox profile for testing purposes. | ||
// This prevents users from having to re-login-to sites before testing. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit This comment should be moved into the switch above. (I'll do this.) |
||
const findPathPromise = new Promise((resolvePromise, rejectPromise) => { | ||
finder.getPath('default', (error, profile) => { | ||
finder.getPath(getFFProfileName(), (error, profile) => { | ||
if (error) { | ||
rejectPromise(error); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition. Thanks!