First discovered by the Norwegians in the 12th century , the islands served as an international whaling base during the 17th and 18th centuries .