Can we remove the try/catch if we check `'documentMode' in document` instead?