Spanish police were on Friday working on the theory that attacks in Cambrils and Barcelona were connected, as well as a Wednesday night explosion in the town of Alcanar in which one person was killed.