It will work on runtime only for the moment.
There is some work done, from what I know, to expose editor scripting in Playcanvas at some point. For now you will have to inject your code using a browser extension or the console, take a look at this post: