Add a Visualforce option to disable injection of a few <script> tags, perhaps by adding a "dontInjectScript" attribute or by including the desired behavior in another attribute, such as the "applyHtmlTag" attribute.
In particular, these are the script tags which are injected:
The HTML templates that our app use are stored as Visualforce pages. This is nice because we can use VF components like <apex:repeat> and use Apex controllers. These templates are secretly injected with <script> tags. While not malicious, we don't need them and they are severely slowing our app. I looked through the Salesforce docs, and I see no options for this.
applyHtmlTag="false"> <!-- When 'true', this should disable script injection. -->
As you can see, we have suppressed as many SF-injected scripts and styles as we can, but those two are still being added.
I profiled the app to discover what was causing this severe performance bottleneck, and I discovered that the HTML templates we request from Visualforce have been injected with <script> tags in the page's <head>. When these templates are added to the page, the browser sees these script tags and stops adding the template until the referenced scripts have been fetched. This can take 200+ms per script. Way too high.
Now, how do we remove them for *all* users of our app, not just those with a customized browser? I have added a workaround to our app - custom code to strip these <script> tags, but a better solution is to not inject them in the first place.