How to I add a JS file (service worker) to the root folder of website in Sitejet?

Hello,

If I want to use another SaaS service with Sitejet that is required to place a service worker or JS file to the root or public folder, how should I do that in Sitejet platform?

PS – I did try using the File Manager Upload and Media Upload, but the system would not allow me to upload the JS file type.

Hi @Natapol_Supmanu ! Welcome to SiteJet Community!
I don’t have the issue you are describing, I can upload JS files in the Media Manager.

Do you get any specific error?
Can you try to hard refresh the Editor CMS page.

Thank you for the reply. I tried again with different JS files. They all were uploaded perfectly. However, when I just created a simple text and saved as a JS extension file name same as the problem one, it did not load. Is there a limit of the length of the name? That one was peculiarly long.

Is this error still current, @Natapol_Supmanu ? If so, could you please send us a mail to help@sitejet.io with the link to here of course? I will forward this to the developers to check on that.

Hi,

I’m a bit surprised by the answers that seem to have missed one very crucial part. Service Workers have to be in the root folder.

A redirect wont help.

Is it any kind of work around to actually add a javascript file to the root so it’s possible to use service workers?

I really hope so because I like Sitejet, but I do need to be able to register a service worker.

Best regards,
Daniel

Hi! I’ve createad a feature request for Service Workers here: Add support for service workers

Please add your input there.

Thank you very much, Lucian. This feature is much needed as long as it would not compromise the security at SiteJet.

Thank you Andre. Sorry for the late reply as I got tied up in RL. Anyway, the issue still exists. I will try to create a video screenshot and send the email.

Thank you. Please also send the link to this thread with the mail :wink: