I would like to be able to close the Immersive Reader in code, without the need for user intervention. Is there a way to do this?
You can use the ImmersiveReader.close() function to close the Immersive Reader. The documentation is available here.
ImmersiveReader.close()