Fix issue with exiting fullscreen on webkit

Closes #297