Fixed url parsing in background.js