If you are in worker mode, only addons have the capability to indirectly reference DOM Elements.
But that is not possible from Eventsheet Scripting.
DOM Elements like document and windoware not available in worker mode.
Although you might not see the "window" term attached before "history" or "location", they actually refers to the window object. So, in your case you are trying to reference the window.history and window.location objects.