Prevent background page from redirecting to cp/build when adding menu links.

From #6520.

I have no idea if this solves the issue the user was having. It was an issue I was having, so I fixed it.