Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save juliandescottes/045bd48d3d0b006a33225ab67f909d9b to your computer and use it in GitHub Desktop.
Save juliandescottes/045bd48d3d0b006a33225ab67f909d9b to your computer and use it in GitHub Desktop.
Create debugger html compare URL
async function createCompareURL(attachmentUrl) {
let attachment = await fetch(attachmentUrl);
let patch = await attachment.text();
let oldHash = patch.match(/\-Taken from upstream commit: ([a-f0-9]+)\n/)[1];
let newHash = patch.match(/\+Taken from upstream commit: ([a-f0-9]+)\n/)[1];
let compareUrl =
`https://github.com/devtools-html/debugger.html/compare/${oldHash}...${newHash}`;
console.log(compareUrl);
}
createCompareURL("https://bug1427187.bmoattachments.org/attachment.cgi?id=8938964");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment