The current SDK has some quirks regarding the WEB_PLATFORM APIs that rely on the iFrame url parameter (i.e. getObjectId, getActionId, getActionTargets, getLocale)
You should save those values at the beginning of the script when your plugin page loads, and so that you don't have to call those APIs again after a modal dialog is opened and closed.
We're working on improving this.