Skip to content
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 Chromium data for optional_permissions Web Extensions manifest property #24093

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

queengooborg
Copy link
Collaborator

@queengooborg queengooborg commented Aug 10, 2024

This PR updates and corrects version values for Chromium (Chrome, Opera, Samsung Internet, WebView Android) for the optional_permissions Web Extensions manifest property. This sets the feature(s) to a version range based upon the date that the feature was added to BCD with the intent of replacing true values with ranged values to eliminate true values from BCD.

This PR uses the source code and commit history of Chrome to add specific version numbers, rather than just ranges. Details for each feature and the commit the version number chosen is available in the commit messages for this PR.

… property

This PR updates and corrects version values for Chromium (Chrome, Opera, Samsung Internet, WebView Android) for the `optional_permissions` Web Extensions manifest property. This sets the feature(s) to a version range based upon the date that the feature was added to BCD with the intent of replacing `true` values with ranged values to eliminate `true` values from BCD.

Commit/PR Adding the Feature: mdn#1673, mdn#1771, mdn#5840, mdn#6112, mdn#12155
@queengooborg queengooborg added the data:webext 🎲 Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions label Aug 10, 2024
Commit: https://chromium.googlesource.com/chromium/src/+/006236a292a8dec7b134b3db35bc1d9ea7767513
Commit Date: February 24, 2012
Chrome 19 Feature Freeze: March 9, 2012
Commit: https://chromium.googlesource.com/chromium/src/+/b62972dac61add19354116b5549ba624b982f14f
Commit Date: June 21, 2012
Chrome 22 Feature Freeze: July 20, 2012
Commit: https://chromium.googlesource.com/chromium/src/+/607e6522f841933e0d3130c09d33207876850948
Commit Date: January 25, 2012
Chrome 19 Feature Freeze: March 9, 2012
Commit: https://chromium.googlesource.com/chromium/src/+/641bdeb0830b56bd715699126176cc750c10fb92
Commit Date: March 22, 2012
Chrome 20 Feature Freeze: April 20, 2012
Commit: https://source.chromium.org/chromium/chromium/src/+/d791ad1ba1cd9246b83ecf3a8622006706fb9605
Commit Date: August 22, 2013
Chrome 31 Feature Freeze: September 6, 2013
Commit: https://chromium.googlesource.com/chromium/src/+/d9c1ade4d29daf457cadbfdf15c71e92e5ffeebb
Commit Date: January 9, 2012
Chrome 18 Feature Freeze: January 13, 2012
Commit: https://source.chromium.org/chromium/chromium/src/+/2b41a696076298ceaaf1d74e01d7c38511852bbf
Commit Date: January 22, 2012
Chrome 19 Feature Freeze: March 9, 2012
@queengooborg queengooborg added the KR: Real BCD 🔑 Key Result: Eliminate true/null values and replace them with "real" values. label Sep 3, 2024
@queengooborg
Copy link
Collaborator Author

I've now tagged all of the PRs that remove "true" and "null" with the "KR: Real Values" tag. @rebloor, if you could prioritize reviewing those PRs over the other ones I've opened (and am opening), that would be most appreciated!

@rebloor
Copy link
Collaborator

rebloor commented Sep 4, 2024

@queengooborg could you explain your sources? For example, why is nativeMessaging marked as Chrome 27. (The only reference here is to a Firefox related PR.)

@queengooborg
Copy link
Collaborator Author

The commits for each of the features have the infomation for the sources used -- check each commit to find out more!

@rebloor rebloor requested review from dotproto and removed request for rebloor October 1, 2024 22:45
@rebloor
Copy link
Collaborator

rebloor commented Oct 1, 2024

@queengooborg these should go to someone more familiar with the Chrome repos, I think @dotproto should be able to help.

@danielhjacobs
Copy link
Contributor

Maybe @Rob--W could help. I know that's the Firefox team but I know Rob has looked into the timing of Chromium feature freezes and browser version releases a lot recently when reviewing #24279 (comment)

@Rob--W
Copy link
Member

Rob--W commented Oct 5, 2024

Maybe @Rob--W could help. I know that's the Firefox team but I know Rob has looked into the timing of Chromium feature freezes and browser version releases a lot recently when reviewing #24279 (comment)

Thanks for tagging me. I have quite a bit of background there because I used to contribute to Chromium before, years before joining Mozilla to work on Firefox, which is useful to pinpoint the exact version where a feature was introduced. I'll post a review for one specific permission, and encourage current Google people to verify the accuracy of the updated PR (e.g. @oliverdunk, who is a devrel of Chrome extension).

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The identified version information is incorrect because the underlying methodology is incorrect. Here is a write-up for the "activeTab" permission, which the PR currently attributes to Chrome 21, but is actually from Chrome 26.

According to your commit message ( 829c5f7 ), the source for version 21 is:

Commit: https://chromium.googlesource.com/chromium/src/+/f3b25bf85396e81487f4af43da9b332960c854e4
Commit Date: May 24, 2012
Chrome 21 Feature Freeze: June 1, 2012

This referenced commit introduced the "activeTab" permission, but restricted to "dev" channel, which is pre-release channel and typical for new APIs that are under development. You can see the mention "channel": "dev" in _permission_features.json. (For individual APIs, _api_features.json has something similar).

The referenced commit has a BUG= line. I put crbug.com/ in front of it to get the redirect the actual bug tracker, in this case crbug.com/93903 -> https://issues.chromium.org/issues/40616924 (the issue number is different because Chromium migrated to a new issue tracker).

In there I see a comment/commit mentioning availability to the stable release channel, at https://issues.chromium.org/issues/40616924#comment31:

Make the activeTab permission available to stable channel.

I was about to look up the version associated with this commit, but saw that the patch was reverted later, and ultimately re-enabled in https://issues.chromium.org/issues/40616924#comment36 with commit message

Revert 172213 - feature is ready.

(This is the revert of the revert of the original patch)

The commit link in the comment is http://src.chromium.org/viewvc/chrome?view=rev&revision=181116 and is the old unsupported SVN repository before the git migration. Where git uses hashes, svn used sequential numbers to index individual commits.

The easiest way to find the commit in the current Git repo is by prepending crrev.com/ in front of it, crrev.com/181116 in this case, which redirects to https://chromium.googlesource.com/chromium/src/+/50ea4940c20d18da1bf210b49e166a3e2062df9e

Now we have link to the source tree, we can follow the remainder of the method I explained before at #24279 (comment) . The actual link in this case differs because we start from the googlesource site instead of Chromium codesearch. (If you really want to use the latter you can copy the commit hash to the Chromium codesearch site)

You can click on "Tree", "chrome", "VERSION" (or modify the URL), and thus find https://chromium.googlesource.com/chromium/src/+/50ea4940c20d18da1bf210b49e166a3e2062df9e/chrome/VERSION, which contains:

MAJOR=26
MINOR=0
BUILD=1406
PATCH=0

As explained before at #24279 (comment) , because the major version is before version 39, the MAJOR version update was manual and so we need to confirm that the BUILD number of the actual release is lower than the listed version. An easy way to get the version is to use your favorite search engine for "Chrome 26.0" (the minor version is always zero), and then I find that the version number starts with 26.0.1410. 1406 is before 1410, so the identified version number is correct.

Note: in this write-up I used the linked Chromium bug to find the relevant commit that shipped to stable, but if that is unavailable, a general method is to use blame on the _permission_features.json file to find the relevant changeset.

webextensions/manifest/optional_permissions.json Outdated Show resolved Hide resolved
@rebloor
Copy link
Collaborator

rebloor commented Oct 6, 2024

@queengooborg, does this feedback apply to all the other Chrome version updates PRs? If it does and you would like me to check them, could you please lay out the determination of the version number in a similar way to Rob's approach so I can check without redoing from scratch? Otherwise I'll leave for the folks from Google to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:webext 🎲 Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions KR: Real BCD 🔑 Key Result: Eliminate true/null values and replace them with "real" values.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants