check window script context in will handle navigation callback