Opening a file does not trigger the discard changes warning since it's being implemented through the window's beforeunload event.