Skip to content

Conversation

@carlosjeurissen
Copy link

@oliverdunk made sure to also consider the different interpretation of the version by Chromium as discussed in w3c/webextensions#878. The check also compares the version from management.getSelf() with runtime.getVersion() as intended by Chromium.

@kiaraarose since this is very early in the wpt process for webExtensions, switched to semicolons and double space as that seems to be most common for js in wpt tests. However, happy to revert back.

@zombie FYI

@wpt-pr-bot
Copy link
Collaborator

There are no reviewers for this pull request. Please reach out on the chat room to get help with this. Thank you!

async function browserRuntimeGetVersion() {
const version = browser.runtime.getVersion();
browser.test.assertEq(typeof version, "string");
browser.test.assertTrue(version === "1.01" || version === "1.1");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a comment that explains that leading zeroes are handled differently across browsers?

Copy link
Author

@carlosjeurissen carlosjeurissen Jan 6, 2026

Choose a reason for hiding this comment

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

Ideally we would have runtime.getVersion() specified somewhere with a note the version number is up for interpretation by the implementation but has to be consistent with other APIs (like the management API).

We may want to make the version validator more strict in mv4, see w3c/webextensions#878 (comment)

Edit: updated the PR with a comment.

@carlosjeurissen carlosjeurissen force-pushed the feat/web-extensions/runtime-get-version branch from c6058de to f6fb547 Compare January 6, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants