mootools/mootools-core — Issue #2220: Request.processScripts always evals .js files.
Author: ibolmo
Created: 2012-01-19 08:15:54+00:00
State: open
Labels: api, bug, enhancement, semantic

(from [Lighthouse](https://mootools.lighthouseapp.com/projects/2706/tickets/957-auto-exec-js))

``` javascript
processScripts: function(text){
if (this.options.evalResponse || (/(ecma|java)script/).test(this.getHeader('Content-type'))) return $exec(text);
return text.stripScripts(this.options.evalScripts);
}
```

After a little trip to the Request class I realized that all js files are being exec. Is there any reason why you are imposing this? We have the option of exec something that is NOT js but we DONT have the options of NOT exec something that is js??? Is it possible you guys can rework the class or give us an extra option for this?

---

(from [comment](https://mootools.lighthouseapp.com/projects/2706/tickets/957-auto-exec-js#ticket-957-7))

Im working on a "desktop app" that runs in the browser... it is fetch from a server (not necessarily from the internet, in most cases the server is in an embedded device) and we want to prefetch scripts at a certain time but not execute them up front. Scripts must be managed later when they are needed due to the nature of the project (but they must have been loaded and stored already). The scripts will be eval but we are the ones that will decide when.

Anyhow I think the code should give the user the flexibility to choose whether the scripts get executed or not.