The location hack is a safe and easy way to execute a function defined in the page:
location.assign("javascript:window.onChange('incident.category');void(0)");
It's a lot like running a bookmarklet from within a Greasemonkey script, so it's perfect for scripts that need to a reference only a few things from the page. And, because javascript:
URLs always execute in the content scope, this method does not have any of the security concerns that come with using unsafeWindow
.