Fórumok

PB: obfuscated javascript in liferay 5.2.2, no debug possible

vince bruel, módosítva 15 év-val korábban

PB: obfuscated javascript in liferay 5.2.2, no debug possible

New Member Bejegyzések: 2 Csatlakozás dátuma: 2009.03.23. Legújabb bejegyzések
Hello,
My javascripts are obfuscated by liferay 5.2.2, which they were not in my previous version (5.1.x).
I used to work (in 5.1.x) with firebug to debug javascript embeded in the portlet's war, which is no longer possible since
javascript have only one line: javascript seems to be obfuscated/compressed by the deployment module of liferay.
Does anyone knows how to tell liferay not to obfuscate/compress javascripts ?
May be there is a startup option somewhere to say that ?

Thanks in advance for your response.
thumbnail
Olaf Kock, módosítva 15 év-val korábban

RE: PB: obfuscated javascript in liferay 5.2.2, no debug possible

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
you might want to set javascript.fast.load to false in your portal-ext.properties. See the default, make sure to set to true once debugging is finished (or generally: in production environments)
vince bruel, módosítva 15 év-val korábban

RE: PB: obfuscated javascript in liferay 5.2.2, no debug possible

New Member Bejegyzések: 2 Csatlakozás dátuma: 2009.03.23. Legújabb bejegyzések
Thanks, it really helped me.
I solved the pb with two shell commands (if it could help someone else):

cat <<EOF > liferayDebugMode.sh
set -e
# Replace here YOUR_LIFERAY_HOME_DIRECTORY with your liferay's home directory
cd $YOUR_LIFERAY_HOME_DIRECTORY/tomcat-6.0.18/webapps/ROOT/WEB-INF/classes

# portal-developer.properties contains javascript.fast.load=false and other usefull things
cp portal-developer.properties portal-ext.properties
EOF

cat <<EOF > liferayProductionMode.sh
mv $YOUR_LIFERAY_HOME_DIRECTORY/tomcat-6.0.18/webapps/ROOT/WEB-INF/classes/portal-ext.properties /tmp
EOF

chmod a+x liferayDebugMode.sh liferayProductionMode.sh
thumbnail
Sohui Gu, módosítva 14 év-val korábban

RE: PB: obfuscated javascript in liferay 5.2.2, no debug possible

Regular Member Bejegyzések: 115 Csatlakozás dátuma: 2006.07.07. Legújabb bejegyzések
Olaf Kock:
you might want to set javascript.fast.load to false in your portal-ext.properties. See the default, make sure to set to true once debugging is finished (or generally: in production environments)


That 's great,It works

Thanks very much, Olaf Kock
Emmr Jobe-Birn, módosítva 10 év-val korábban

RE: PB: obfuscated javascript in liferay 5.2.2, no debug possible

New Member Bejegyzések: 2 Csatlakozás dátuma: 2014.02.27. Legújabb bejegyzések
Can anyone explain how to disable JavaScript obfuscation (or minifiy) in Liferay running on Windows Server 2008 R2?
It is causing our JavaScript code to fail by removing semicolons from the last line of code in each {} code block (any if statements, functions, try/catch, etc.), and it adds a semicolon after the last "}".
I posted full details in here.
Thanks
thumbnail
Olaf Kock, módosítva 10 év-val korábban

RE: PB: obfuscated javascript in liferay 5.2.2, no debug possible

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
Emmr Jobe-Birn:
Can anyone explain how to disable JavaScript obfuscation (or minifiy) in Liferay...?


This can be done like I described above. Alternatively, add all the properties from portal-developer.properties. Careful: If you do this in production environments, your page load time will suffer a lot: Instead of one minified file you're now requesting potentially dozens of individual files - minification also minifies the number of files to be loaded to 1 css and 1 js file.

If you're running into a bug, you might want to file this on issues.liferay.com

Also, you're not mentioning which version of Liferay you're using - you're posting this as an answer to an article mentioning 5.2.2, which is horrendously old and unmaintained for years now - and you won't have any luck getting it fixed on that version. I've not had any problems with minification so far - wondering where you get yours.