question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support upstream features override (in code) with ability to Griffin-override on top

See original GitHub issue

The variations seed doesn’t support features state apply at the first start. We can implement some chromium_src-based change to alter the default state of Chromium features and still be able to control it via Griffin. Our current approach with appending --enable/disable-features doesn’t allow Griffin overrides.

Reasoning from @pes10k:

Could we change our deployment to make the features enabled by default in code, and then use griffin to disable only if needed? I know that for users it wont make a difference, but it’ll be increasingly important to make sure researchers / bloggers / measurers accurately understand and can replicate the privacy protections we’re providing.

Note: this does not replace master_preferences. The problem with master_preferences is that it’s not supported by selenium-webdriver for example. In reality, all experiments and research made with selenium-webdriver won’t get the actual features state we’re using in production.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
goodovcommented, Jan 4, 2022

Test cases

(1) Feature is enabled by default in Chromium, but disabled by default in Brave. Can be overridden via cmd line.

  1. Ensure Brave doesn’t have Copy link to highlight context menu item when a text on a website is selected and a context menu is triggered (mouse right click).
  2. Start Brave with --enable-features=CopyLinkToText
  3. Expect the menu item is available.

(2) Feature is disabled by default in Chromium, but enabled by default in Brave. Can be overridden via cmd line.

  1. Ensure there is Import passwords item on brave://settings/passwords in Saved Passwords section (click the three-dots button on the right).
  2. Start Brave with --disable-features=PasswordImport.
  3. Expect the item has disappeared.

(3) Control Brave-overridden feature using brave://flags.

  1. Ensure there is Import passwords item on brave://settings/passwords in Saved Passwords section, make sure to cleanup command line after running test case #2.
  2. Open brave://flags, change Password import flag state, relaunch browser.
  3. Expect the item exists or doesn’t exist depending on the flag state.
  4. Expect Default flag state shows the item.
0reactions
GeetaSarvadnyacommented, Jan 4, 2022

Verification PASSED on

Brave | 1.34.78 Chromium: 97.0.4692.71 (Official Build) (64-bit)
-- | --
Revision | adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}
OS | Windows 10 Version 21H2 (Build 19044.1415)

Case 1: `Copy link to highlight` context menu
  • Confirmed by default brave doesn’t have a Copy link to highlight context menu item when a text is selected on any website
  • Confirmed Copy link to highlight context menu item is shown when a text is selected on any website when brave is launched using --enable-features=CopyLinkToText
brave default brave with cmd line
image image
Case 2: Import passwords
  • Confirmed by default brave has Import option displayed in 3dot menu under Saved Passwords in brave://settings/passwords
  • Confirmed 3dot menu with Import option is disappeared when brave is launched via cmd line --disable-features=PasswordImport
brave default brave with cmd line
image image
Case 3: Control `Import password` via brave://flags
  • Confirmed enable/disable Import password option in brave://settings/passwords is controlled via brave://flags
Password import flag Default or Enable Disable
image image image

Verified using:

Brave | 1.34.78 Chromium: 97.0.4692.71 (Official Build) (x86_64)
-- | --
Revision | adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}
OS | macOS Version 11.6.1 (Build 20G224)
Case 1: `Copy link to highlight` context menu - PASSED
  • Confirmed by default Brave doesn’t have a Copy link to highlight context menu item when a text is selected on any website
  • Confirmed Copy link to highlight context menu item is shown when a text is selected on any website when Brave is launched using --enable-features=CopyLinkToText
brave default brave with cmd line
Screen Shot 2022-01-04 at 12 43 14 PM Screen Shot 2022-01-04 at 12 47 43 PM
Case 2: Import passwords - PASSED
  • Confirmed by default Brave has Import option displayed in 3dot menu under Saved Passwords in brave://settings/passwords
  • Confirmed 3dot menu with Import option is disappeared when Brave is launched via cmd line --disable-features=PasswordImport
brave default brave with cmd line
Screen Shot 2022-01-04 at 1 09 12 PM Screen Shot 2022-01-04 at 1 09 36 PM
Case 3: Control `Import password` via brave://flags - PASSED
  • Confirmed enable/disable Import password option in brave://settings/passwords is controlled via brave://flags
Password import flag - Default Password import flag - Enable Password import flag - Disable
Default Enabled Disabled
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deal with dangerous web features · Issue #15637 - GitHub
We routinely disable web-accessible features in Chromium which we consider to be dangerous ... Support upstream features override (in code) with ability to...
Read more >
Overriding in Java - GeeksforGeeks
The ability to exist code libraries to call methods on instances of new classes without recompiling while maintaining a clean abstract interface ...
Read more >
override modifier - C# Reference | Microsoft Learn
Beginning with C# 9.0, read-only overriding properties support covariant return types. The overridden property must be virtual , abstract , or ...
Read more >
Overriding and Hiding Methods (The Java™ Tutorials ...
The ability of a subclass to override a method allows a class to inherit from a superclass whose behavior is "close enough" and...
Read more >
How to Override Features | Phase2 Technology
php for variable overrides, making ongoing support tricky. Best for Environment variables rather than for any generic Drupal variable. Update ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found