Can you tell me how to make extension to take a picture without user interaction?

An open-source extension has already done this (credit @Kumaraswamy):

1 Like