web-ext icon indicating copy to clipboard operation
web-ext copied to clipboard

feat: Add `--chromium-pref` flag

Open aklinker1 opened this issue 1 year ago • 11 comments

Overview

This closes #2899.

Add a new parameter, --chromium-pref, which lets users configure some profile settings when running the web-ext run command. For default preferences, I set extensions.ui.developer_mode=true so you don't have to toggle the developer mode switch every time you run an extension on chromium.

https://github.com/mozilla/web-ext/blob/9d0512a1a5c3d9100764ff4bfec037c23e44ed15/src/extension-runners/chromium.js#L30-L32

Manual Testing

Here's the commands I ran to do manual testing:

# Default, dev mode should be enabled at chrome://extensions
node .\bin\web-ext.js run -s .\tests\fixtures\minimal-web-ext\ -t chromium
# Disable dev mode, change download dir (chrome://settings/downloads)
node .\bin\web-ext.js run -s .\tests\fixtures\minimal-web-ext\ -t chromium --chromium-pref extensions.ui.developer_mode=false --chromium-pref download.default_directory="C:\Users\Aaron\Downloads\test"

aklinker1 avatar Oct 15 '23 17:10 aklinker1

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.31%. Comparing base (17d1c4b) to head (b1779d9).

:exclamation: Current head b1779d9 differs from pull request most recent head 61e8a86

Please upload reports for the commit 61e8a86 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2912       +/-   ##
===========================================
+ Coverage        0   99.31%   +99.31%     
===========================================
  Files           0       32       +32     
  Lines           0     1759     +1759     
===========================================
+ Hits            0     1747     +1747     
- Misses          0       12       +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 15 '23 18:10 codecov[bot]

Rebased and fixed merge conflicts

aklinker1 avatar Oct 31 '23 18:10 aklinker1

Rebased and fixed conflicts

aklinker1 avatar Nov 12 '23 16:11 aklinker1

No conflicts present with Branch

VersoriumX avatar Dec 23 '23 18:12 VersoriumX

@aklinker1 why not merge this pr? I still encounter the content script source map issues

pftom avatar May 30 '24 03:05 pftom

Only maintainers can merge PRs, and this hasn't been approved by one.

aklinker1 avatar May 30 '24 04:05 aklinker1

@VersoriumX I appreciate your approvals, but since you're not a maintainer, you approving this more than once doesn't really help

aklinker1 avatar May 31 '24 02:05 aklinker1

Sorry for the delay here - I've put this on my list of tasks to review. We are supportive of the requested capability here.

Rob--W avatar Jun 06 '24 12:06 Rob--W

@Rob--W no worries! Thanks for the update

aklinker1 avatar Jun 06 '24 13:06 aklinker1

@Rob--W Thanks for the review! I'll update this branch and make the suggested changes once chrome-launcher is updated. I created a PR: https://github.com/mozilla/web-ext/pull/3200

aklinker1 avatar Jul 16 '24 16:07 aklinker1