Please help me with a JavaScript button chrome extension thing [closed]

I need help with a chrome extension that would add a button to the bottom of a specific website. The button should link to an edited version of the sites url.

For example, If the URL is https://www.example.com/part1/part2 the button would need to link to https://www.example.com/part3/part2 and I need it to be reusable so I can’t just put a URL there because the part2 will vary. Thanks

I’ve tried searching for solutions, but nothing worked.