PHPBB3 without JavaScript - fontawesome

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

Hi community

For a whistle-blowing project, I want to use PHPBB as a part of the project and host it anonymously.
This requires deactivation of JavaScript. I am using the latest version of PHPBB 3.3.14.

How can I get the icons to show when JavaScript is turned off. I believe this has to do with fontawesome.

Is there a workaround to show icons on forum index, for PMs, posting, etc. and get it to work of will this require days and days of replacing code?

I was not able to find any tutorials. Or are there any solutions to this problem such as using a theme that does not use fontawesome?

PS: An option to make JavaScript optional would be a great feature. Especially for users in the non-western world that are more dependent on privacy (China,.... Africa,..., ) and in many countries where surveillance is going ape.
Last edited by weapons102 on Sat Jan 18, 2025 1:12 pm, edited 2 times in total.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6608
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: PHPBB3 without JavaScript - fontawesome

Post by thecoalman »

Unless you have enabled the CDN JS files are loaded locally. The only thing I'm aware that will be loading external files is emojis. , hotlinked images etc.

Did a quick test with JS disabled in the browser and everything worked as expected including the icons. There is no way to disable it but removing the reference to JS files in overall_header.html and overall_footer.html should remove it. There may be others.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

Hi thecoalman
thecoalman wrote: Sat Jan 18, 2025 10:34 am Unless you have enabled the CDN JS files are loaded locally. The only thing I'm aware that will be loading external files is emojis. , hotlinked images etc.

Did a quick test with JS disabled in the browser and everything worked as expected including the icons. There is no way to disable it but removing the reference to JS files in overall_header.html and overall_footer.html should remove it. There may be others.
Thank you for your reply. I have basic knowledge on PHPBB but I am not an expert whatsoever on the architecture.

What part of the overall_header.html do I have to remove? Please forgive my ignorance.

Any chance you could paste that part here so I can compare what you removed?
Last edited by weapons102 on Sat Jan 18, 2025 10:41 am, edited 1 time in total.
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

thecoalman wrote: Sat Jan 18, 2025 10:34 am
Did a quick test...
What exactly did you do to the code for the "quick test"?
I removed all the <script> sections and still the buttons don't show. Instead a four letter number combination is shown.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6608
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: PHPBB3 without JavaScript - fontawesome

Post by thecoalman »

I moving this to custom coding.

You can disable JS in a browser for testing, I don't what if any issues there might be but phpBB is coded to gracefully fallback when JS is not enabled so there shouldn't be any.

Having a quick look most of the javascript is being loaded in overall_footer.html at the end. There might be other instances including inline JS. You can search the templates for <script>.

Note that when you edit a template you need to purge the cache from ACP.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

thecoalman wrote: Sat Jan 18, 2025 4:22 pm I moving this to custom coding.

You can disable JS in a browser for testing, I don't what if any issues there might be but phpBB is coded to gracefully fallback when JS is not enabled so there shouldn't be any.

Having a quick look most of the javascript is being loaded in overall_footer.html at the end. There might be other instances including inline JS. You can search the templates for <script>.

Note that when you edit a template you need to purge the cache from ACP.
Yes, I always empty the cache but it still does not work.

Just for my understanding. When I disable JavaScript I don't see the icons, only the unicode.

What effect would removing the script tags have if JavaScript is disabled anyway? They would not be executed anyway, I mean.

Maybe I have to tell PHPBB3 to use a local stylesheet and and it in the header? I spent all day today and I cannot figure it out.
User avatar
Mannix_
Registered User
Posts: 2060
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: PHPBB3 without JavaScript - fontawesome

Post by Mannix_ »

in Load Settings in ACP what do you have set for Allow usage of third party content delivery networks: ????
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

Mannix_ wrote: Sat Jan 18, 2025 5:22 pm in Load Settings in ACP what do you have set for Allow usage of third party content delivery networks: ????
It is set to "no".
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

Above that there is:

Recompile stale style components:
Check for updated style components on filesystem and recompile.

Do I have to set to "yes" maybe?
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

weapons102 wrote: Sat Jan 18, 2025 5:25 pm
Mannix_ wrote: Sat Jan 18, 2025 5:22 pm in Load Settings in ACP what do you have set for Allow usage of third party content delivery networks: ????
It is set to "no".
I just tried "yes" and "no" for this option and deleted the cache twice. It has no effect. I still see unicode instead of icons with JavaScript turned off. It does not use any local fontawesome. Or do I have to modify anything in the templates?
User avatar
Mannix_
Registered User
Posts: 2060
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: PHPBB3 without JavaScript - fontawesome

Post by Mannix_ »

There is something odd going on. Normally font awesome is loaded locally via css file unless you have that option set to yes then it's delivered by js. Do you have any errors in the browser console ??
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

Mannix_ wrote: Sat Jan 18, 2025 5:49 pm There is something odd going on. Normally font awesome is loaded locally via css file unless you have that option set to yes then it's delivered by js. Do you have any errors in the browser console ??
I have this in the browser console:

Code: Select all

Content-Security-Policy: The page’s settings blocked the loading of a resource (media-src) at data: because it violates the following directive: “media-src http: file:” 3 index.php
As I wrote the site has to be hosted anonymously (Tor) so I don't know if that is important.
User avatar
Mannix_
Registered User
Posts: 2060
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: PHPBB3 without JavaScript - fontawesome

Post by Mannix_ »

Do you do your testing the Tor browser? Maybe it is blocking the display of the icons somehow. Did you check if the icons work in normal browser?
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

Mannix_ wrote: Sat Jan 18, 2025 7:04 pm Do you do your testing the Tor browser? Maybe it is blocking the display of the icons somehow. Did you check if the icons work in normal browser?
Yes, in another browser it seems to work. I deleted the browser cache.

So it must be related to this message: “media-src http: file:” 3 index.php


media-src. Is that in the CSS?

Can I do a workaround?
weapons102
Registered User
Posts: 19
Joined: Sat Jan 18, 2025 9:58 am

Re: PHPBB3 without JavaScript - fontawesome

Post by weapons102 »

I googled it and found this:

https://developer.mozilla.org/en-US/doc ... /media-src

I don't think that is realted to CSS:

Return to “phpBB Custom Coding”