The problem is in the `executeScriptFile` function that executes the file code in the main frame scope only.