From 751a2d3e638e1c4c54eab3bb492d7331243f2546 Mon Sep 17 00:00:00 2001 From: Jorrit Tinholt Date: Thu, 17 Sep 2026 09:42:01 +0200 Subject: [PATCH] Use GitHub's renamed page_data/stacks endpoint GitHub renamed the stack page_data route from stack to stacks, so the old path returns 404 and every stack fell back to loading the full PR page. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 2 +- src/content.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4791b07..0ca9e43 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ A temporary add-on is removed when Firefox restarts, so repeat step 2 after a re ## How it works - 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. -- 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. +- 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. - 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. - Fold state per stack is kept in `storage.local`; the default lives in `storage.sync`. The APIs are reached through `browser` when it exists and `chrome` otherwise, because Firefox's `chrome` alias is the diff --git a/src/content.js b/src/content.js index 841ec48..ebddeb5 100644 --- a/src/content.js +++ b/src/content.js @@ -106,7 +106,7 @@ const base = `/${pull.owner}/${pull.repo}/pull/${pull.number}`; // Same endpoint GitHub's own stack badge dialog uses (requires a signed-in session). try { - const response = await fetch(`${base}/page_data/stack`, { + const response = await fetch(`${base}/page_data/stacks`, { credentials: "same-origin", headers: { Accept: "application/json",