Embed JS file to page

Hi, is there way to embed Javascript file in the page root ,
I mean if site url mydomain.com
i need the JS file to be in mydomain.com/sw.js
@emmanuel @AliFarahat

I don’t think so

even through plugin?!

What’s the outcome you’re trying to achieve by doing this? …wonder if there’s another way to get the same outcome, but with a different approach.

Must the code reside at your domain? If you simply want to reference and use some JS code throughout your site, you can add it to the Shared section of your own plugin.

Exactly.

If you just need the file to be usable\reachable within your application, one way to go is to create a date type File in your DB, with a field type file, then create the new entry in the table and upload the .js file into your application DB.

The link provided by the file will be usable within your application (and outside of it too, in fact).

Otherwise - the direct links to the files with the bubble application FQDNs are not supported to my best knowledge.

Vlad.

GM at Bubblewits - #1 no-code developer

https://zeroqode.com – a place to buy Bubble templates for UI Kits, clone apps, dashboards, landing pages and much more
https://iambubble.com - one page Bubble demo
http://builtwithoutcode.com/ - Collection of apps built on Bubble

@sudsy @vladlarin thank you for answers and support much appreciate

I’m tiring to make offline first web app using service worker from polymer or google , service worker required the sw.js to be in same page domain “for security reason” and cannot be used from external url ,

@sudsy when I upload sw.js in shared section at plugin I get long url (( dd7tel2830j4w.cloudfront.net/f1503755933020x330874383682385100/sw.js ))

I wonder if just copying and pasting the contents of sw.js into a script tag in the head will work.

@sudsy I tried but dos not work , check this tutorial link for reference for what i’m trying to achieve

Unfortunately, I don’t yet have experience with web workers, but I’d be curious to know if you get it working. Good luck!

1 Like

thanks, i will contact bubble team and see if we can find solution for it

This topic was automatically closed after 70 days. New replies are no longer allowed.