Fix disableLeavePrompt()

Sometimes, unsafeWindow or unsafeWindow.document.body did not exist,
this caused the function to throw an error.
Merge pull request #491 from devnoname120/linkbucks

Fix Linkbucks