When the page already exists in a window then we can't be restoring pages so stop checking. The "window" variable will be nullptr if we're trying to open the page "in any window". This bug was introduced in the changes for bug 798564.