Fix issue with undefined screencap. Refactor screen capture into a standalone function. Remove tabCapture permission (not needed).