Issue 6876: 'TypeError: target is undefined' on right-click in Script panel