This GreaseMonkey/TamperMonkey/ViolentMonkey script aims at solving the issue raised in https://github.com/orgs/community/discussions/42581, i.e. closing an unsubmitted GitHub issue, and losing quite a lot of work.
This will display a confirmation popup before closing a tab with an unsubmitted issue, so that you don't close it by mistake.