Skip to content

Commit 56d217f

Browse files
authored
Merge pull request #3 from dejorrit/fix-stack-endpoint
Use GitHub's renamed page_data/stacks endpoint
2 parents bf84260 + 751a2d3 commit 56d217f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ A temporary add-on is removed when Firefox restarts, so repeat step 2 after a re
2828
## How it works
2929

3030
- Rows are found by GitHub's stack badge (`aria-label="Pull request stack, position X of Y"`). The badge doesn't say *which* stack a PR is in, and position/size alone can't tell apart two stacks of the same size.
31-
- For each stack, the extension makes one same-origin request with your GitHub session. It first tries `/{owner}/{repo}/pull/{n}/page_data/stack` (the endpoint GitHub's badge popup uses), then falls back to the stack JSON embedded in the PR page. The response lists every PR in the stack with its title and state.
31+
- For each stack, the extension makes one same-origin request with your GitHub session. It first tries `/{owner}/{repo}/pull/{n}/page_data/stacks` (the endpoint GitHub's badge popup uses), then falls back to the stack JSON embedded in the PR page. The response lists every PR in the stack with its title and state.
3232
- Rows are regrouped with CSS `order` on the existing list items instead of moving GitHub's DOM nodes, so GitHub's React code keeps working. Keyboard navigation still follows GitHub's original order.
3333
- Fold state per stack is kept in `storage.local`; the default lives in `storage.sync`. The APIs are reached
3434
through `browser` when it exists and `chrome` otherwise, because Firefox's `chrome` alias is the

‎src/content.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
const base = `/${pull.owner}/${pull.repo}/pull/${pull.number}`;
107107
// Same endpoint GitHub's own stack badge dialog uses (requires a signed-in session).
108108
try {
109-
const response = await fetch(`${base}/page_data/stack`, {
109+
const response = await fetch(`${base}/page_data/stacks`, {
110110
credentials: "same-origin",
111111
headers: {
112112
Accept: "application/json",

0 commit comments

Comments
 (0)