This repository was archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
Terminology update, removal of unused macros, repo & comments #273
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c742c74
Update AddonSidebar.ejs
andrewtruongmoz 20932b1
Terminology update, removal of unused macros, repo&comments
andrewtruongmoz dff4704
revert table comment
andrewtruongmoz b1e811c
Comments update
andrewtruongmoz d55af24
editing discourse link
andrewtruongmoz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| /** | ||
| WebExtBrowserCompat.ejs | ||
| ----------------------- | ||
| Use this macro to insert the appropriate WebExtension compat table for the | ||
| Use this macro to insert the appropriate Extension compat table for the | ||
| current page. | ||
|
|
||
| It takes one optional argument. | ||
|
|
@@ -15,7 +15,7 @@ this function only supports tables for manifest.json keys. | |
| * If the argument is omitted, the macro calls tableFromSlug(), which uses | ||
| the slug of the current page to get the right chunk of JSON data for the | ||
| table. The no-argument form is only allowed on pages under | ||
| "Add-ons/WebExtensions/API/". | ||
| "Add-ons/Extensions/API/". | ||
| */ | ||
|
|
||
| /** | ||
|
|
@@ -42,7 +42,7 @@ function tableFromArgument(path) { | |
| const manifestDataUrl = "https://raw.githubusercontent.com/mdn/browser-compat-data/master/webextensions/manifest-keys.json"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is renaming this (https://raw.githubusercontent.com/mdn/browser-compat-data/master/webextensions/manifest-keys.json) is on the eventual plan as well? |
||
| // if the argument does not specify a manifest key, generate the aggregate table | ||
| if (pathComponents.length === 2) { | ||
| const manifestBaseUrl = "Add-ons/WebExtensions/manifest.json"; | ||
| const manifestBaseUrl = "Add-ons/Extensions/manifest.json"; | ||
| compatJson = mdn.fetchJSONResource(manifestDataUrl).data.webextensions.manifest; | ||
| return template("WebExtBrowserCompatTable", [compatJson, manifestBaseUrl]); | ||
| } else { | ||
|
|
@@ -57,33 +57,33 @@ This function transforms the URL of the current page into a path through | |
| the compat data, and uses this path to retrieve the appropriate bit of data. | ||
| For example: | ||
|
|
||
| https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/alarms | ||
| https://developer.mozilla.org/en-US/Add-ons/Extensions/API/alarms | ||
| ...would become data["alarms"] | ||
|
|
||
| https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/alarms/get | ||
| https://developer.mozilla.org/en-US/Add-ons/Extensions/API/alarms/get | ||
| ...would become data["alarms"]["get"] | ||
|
|
||
| One tricky detail is that it needs to handle the devtools APIs, which name | ||
| themselves "devtools.thing": | ||
|
|
||
| https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/devtools.panels | ||
| https://developer.mozilla.org/en-US/Add-ons/Extensions/API/devtools.panels | ||
| ...would become data["devtools"]["panels"] | ||
|
|
||
| It then passes the compat data into "WebExtBrowserCompatTable", which | ||
| builds the table. | ||
|
|
||
| This function may only be called from pages under "Add-ons/WebExtensions/API/". | ||
| This function may only be called from pages under "Add-ons/Extensions/API/". | ||
| */ | ||
| function tableFromSlug() { | ||
| const url = "https://raw.githubusercontent.com/mdn/browser-compat-data/master/webextensions/javascript-apis.json"; | ||
| const webExtAPIBaseUrl = "Add-ons/WebExtensions/API/"; | ||
| const webExtAPIBaseUrl = "Add-ons/Extensions/API/"; | ||
|
|
||
| // Pages that include this macro must be under | ||
| // the "Add-ons/WebExtensions/API/" hierarchy. | ||
| // the "Add-ons/Extensions/API/" hierarchy. | ||
| // So first, let's get the part of the URL following that subpath, or fail. | ||
| var components = env.slug.split(webExtAPIBaseUrl); | ||
| if (components.length < 2) { | ||
| throw "If no arguments are given, then this macro can only be called from pages under \"Add-ons/WebExtensions/API/\""; | ||
| throw "If no arguments are given, then this macro can only be called from pages under \"Add-ons/Extensions/API/\""; | ||
| } | ||
|
|
||
| // Now we're looking at a subpath like: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require renaming the repository. GitHub should redirect the link, so you should do this first.