fix for cross-window Window object comparison

- Learned that window.constructor is not the same between windows. Using
Object.prototype.toString.call() for comparison instead.