Tests: Make the beforeunload event tests work regardless of extensions