I could not find the docs on electron contextBridge and what is done to the API arguments but obviously something is done.
This is the gist of it: