I wrote a post about this same topic last year but it bears repeating.
There's no better favor you can do for your pet and your family than protecting your pets during the 4th of July festivities. In my opinion, it doesn't matter if your pet doesn't seem to be bothered by the UPS truck or a loud motorcycle. The 4th of July fireworks can be an anxiety attack for even the bravest of furry friends.
You will most likely be gone when the booms, bangs and screeches start and alone, in the dark, a pet might look to you for comfort. If you aren't there, they may try anything and everything to escape and try and find you. I still have the vision in my head of a poor dog that was hit by a car on our way home from fireworks two years ago. It makes me so sad to think about the panic that the dog must have felt, trying desperately to find his family.
So, please, before you go out for the evening, lock your pet in your home or crate your friend if they're used to it. You will be happy you did :)