Feature #17035
closedApproach and patch for removing all inline JavaScript
0%
Description
Installations with extensive GMENUs and rollover effects will still have major parts of JavaScript within the HTML source.
This is alright according server load, since this JavaScript mainly consists of image variables which might change on different pages depending on ACT, CUR and the like and therefore would result in different external .js files anyway when outsourced. But there might be circumstances (e.g. beautifying HTML source or optimizing for search engines), where this behaviour is disliked: the actual content of a page is outputted beneath loads of JavaScript code.
As an approach, the following patch against typo3/sysext/cms/tslib/class.tslib_pagegen.php introduces an additional TS property (config.removeAdditionalJS = external might be set), that only will have an effect if TS property config.removeDefaultJS is already set to external. Then, all the inline JavaScript will be outsourced to external files.
If considered to be merged to class.tslib_pagegen.php, the feature config.removeAdditionalJS should be marked as an advanced feature to be applied very carefully, since it requires decent configuration of other parts of the installation - some examples:
- imgNameNotRandom should be set for all menus; else the typo3temp directory will very quickly be congested by .js files (containing randomly named image variables)
- The default JavaScript libraries in media/scripts for [X]MENU_LAYERS (and probably other JavaScripts as well) will not work any more without modification since they rely on inline JavaScript (related to Bug 2970, but it doesn't fully solve the problem).
(issue imported from #M5064)
Files
Updated by Benni Mack over 16 years ago
Hey Ralf,
I set the target version to 4.3 as we forgot about this issue for 4.2 (feature freeze is over) and I definitely want this going in the next version then!
Updated by Ralf Hettinger over 16 years ago
Hi Benjamin,
I have not been sending this to the list for 4.2 since there exist quite a lot of pitfalls that aren't solved by default - as mentioned in the initial report.
config.removeAdditionalJS = external as introduced in the patch could get some installations into serious trouble (believe me, I've had a quite congested tempdir once before - which is no fun at all)...
Updated by Ralf Hettinger over 16 years ago
With 4.2 coming up quickly, there's a new patch since the old one won't work anymore for 4.2
Just in case someone needs this ;)
Updated by Ralf Hettinger almost 15 years ago
New patch which would apply for 4.3 / current trunk...
Updated by Xavier Perseguers over 13 years ago
- Category deleted (
Communication) - Target version changed from 4.6.0 to 4.6.0-beta1
Updated by Xavier Perseguers over 13 years ago
- Target version deleted (
4.6.0-beta1)
Updated by Christian Kuhn over 11 years ago
- Status changed from New to Rejected
With 6.1 issue #46358, the _layers menus where moved to statictemplates, and statictemplates was removed from core afterwards. This issue won't be solved in the core anymore.