Bug 957150 - Fix errors in history deserialization on Metro [r=TimAbraldes a=lsblakk]
Bug 958170: Check selectedWindow exists before using it. r=mbrubeck a=metro-only