I used to have that problem and I recall this making it go away, but it's been a while so I might not be remembering it correctly. https://www.windows10forums.com/threads/are-you-sure-you-want-to-leave-this-page.10329/
If that setting is set to PROMPT, change it to ENABLED or DISABLED and the problem should go away.
If that setting is set to PROMPT, change it to ENABLED or DISABLED and the problem should go away.