Remove trailing comma from hashmap in background.js