Add fragments with ids to JavascriptEnvironment
Always switch context back