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

Data for legacy version of webextension.api.userScripts #25857

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
126 changes: 126 additions & 0 deletions webextensions/api/userScripts_legacy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"webextensions": {
"api": {
"userScripts_legacy": {
"__compat": {
"description": "userScripts (Legacy)",
"support": {
"chrome": {
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68",
"notes": "Only available for use in extensions using Manifest V2."
},
"firefox_android": "mirror",
"opera": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror"
}
},
"RegisteredUserScript": {
"__compat": {
"description": "RegisteredUserScript (Legacy)",
Copy link
Collaborator

@dotproto dotproto Feb 7, 2025

Choose a reason for hiding this comment

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

@rebloor, I'm curious about your motivations for including "(Legacy)" on each of the entries in this data. Is this an established practice? I assume this affects how entries appear in compatibility tables. Does it affect anything else on MDN? Other tooling?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I'm aware, we haven't had a similar situation in the past, so we're inventing "practice" here. In this situation, we have a userScript API implemented in Firefox only for Manifest V2 and an incompatible userScript API for Manifest V3 implemented in Firefox, Chrome, and Safari. In the MDN documentation readers will see the Firefox only version of the API marked up as "legacy" throughout. See mdn/content#37975 description is used as the title in the compatibility tables.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I may have suggested this. If we render the BCD table for this feature, there would be no indication otherwise that this refers to the old API.

I notice that the features have no status set (like experimental, deprecated), which presumably is a special treatment. If it is forbidden to mark a webextensions.api feature as deprecated, then we should probably change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless there's a change I'm unaware of, we have no plans to deprecate Manifest V2 ((https://blog.mozilla.org/addons/2024/03/13/manifest-v3-manifest-v2-march-2024-update/) so by extension we presumably have no plans to deprecate the Manifest V2 version of userScript. @Rob--W

In addition to including the word legacy in the descriptions, wouldn't the mdn_url indicate that it refers to the legacy API?

"support": {
"chrome": {
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68"
},
"firefox_android": "mirror",
"opera": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror"
}
},
"unregister": {
"__compat": {
"description": "unregister (Legacy)",
"support": {
"chrome": {
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68"
},
"firefox_android": "mirror",
"opera": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror"
}
}
}
},
"onBeforeScript": {
"__compat": {
"description": "onBeforeScript (Legacy)",
"support": {
"chrome": {
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68"
},
"firefox_android": "mirror",
"opera": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror"
}
}
},
"register": {
"__compat": {
"description": "register (Legacy)",
"support": {
"chrome": {
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68"
},
"firefox_android": "mirror",
"opera": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror"
}
},
"cookieStoreId": {
"__compat": {
"support": {
"chrome": {
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "98"
},
"firefox_android": "mirror",
"opera": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror"
}
}
}
}
}
}
}
}
15 changes: 6 additions & 9 deletions webextensions/manifest/user_scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
"mdn_url": "https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/manifest.json/user_scripts",
"support": {
"chrome": {
"version_added": "≤78"
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68"
"version_added": "68",
"notes": "Only available for use in extensions using Manifest V2."
},
"firefox_android": "mirror",
"opera": {
"version_added": false
},
"opera": "mirror",
"safari": {
"version_added": false
},
Expand All @@ -26,16 +25,14 @@
"__compat": {
"support": {
"chrome": {
"version_added": "≤78"
"version_added": false
},
"edge": "mirror",
"firefox": {
"version_added": "68"
},
"firefox_android": "mirror",
"opera": {
"version_added": false
},
"opera": "mirror",
"safari": {
"version_added": false
},
Expand Down