Pass window to the plugin function to follow best practices