Returns a noop function if window doesn't exist