The beforeunload, promiserejection, beforetoggle and toggle events were previously not tagged as trusted. This commit properly tags the event so that we match the behaviour implemented by other browsers.