Skip to content

Fix webext.run for zen-browser #1813

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

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions build/webext.run.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import webExt from 'web-ext'
import fs from 'node:fs'
import path from 'node:path'
import { ADDON_PATH } from './utils.js'

let lastArg = process.argv[process.argv.length - 1]
if (!lastArg || lastArg.startsWith('-')) lastArg = 'firefox'

const IS_FF = lastArg.includes('irefox') || lastArg.includes('loorp')
const IS_FF = lastArg.includes('irefox') || lastArg.includes('loorp') || lastArg.includes('zen')
const cliOpts = {
target: IS_FF ? 'firefox-desktop' : 'chromium',
sourceDir: ADDON_PATH,
Expand All @@ -15,11 +16,11 @@ const cliOpts = {
async function main() {
if (IS_FF) {
cliOpts.firefox = lastArg
cliOpts.firefoxProfile = './build/profile-' + lastArg
cliOpts.firefoxProfile = './build/profile-' + path.basename(lastArg).split(".")[0]
await fs.promises.mkdir(cliOpts.firefoxProfile, { recursive: true })
} else {
cliOpts.chromiumBinary = lastArg
cliOpts.chromiumProfile = './build/profile-' + lastArg
cliOpts.chromiumProfile = './build/profile-' + path.basename(lastArg).split(".")[0]
await fs.promises.mkdir(cliOpts.chromiumProfile, { recursive: true })
}

Expand Down