Get the plugin document's URI and pass that as the referrer to the plugin viewer. Part of bug #581857.