Extract variables($window, $scrollbar) from local.