they should let you apply for the visa if you show them your itinerary, and your onward ticket to oslo. the fact that you are legally in the USA should be enough. Otherwise an agent maybe able to help
if you do book a second ticket to HKG to leave shanghai within 48 hours then it will work as a transit without visa, should not affect applying for a visa in HK and you are allowed to leave the airport. PVG to HKG flights are fairly frequent so you might not even have to stay a night