Update background.js

switch from updating the url after the request to changing the url before the request.