Are you calling the html out of your database and dynamically displaying it in an html element on your page? It seems that would force Bubble to display the rendered output and not the code?
Maybe you are and I didn’t understand your comment.
Seems that would be the best approach to get around the way Bubble handles things.
That’s right - in an iframe. Strangely, it worked, and then there seemed to be a change to how bubble stored the files, and it didn’t work any longer. Below are two links: pre- and post- the change. You’ll see the URL is different in terms of where the file is being stored, and the s3 amazon version worked in the iframe.
I did run that code and it looks like Bubble is using sandboxing to prevent the code from using local storage so there’s no malicious code in the embedded content.
There are things you can do like ‘allow-same-origin’ flag. But using it has a lot of security issues.
But, probably the best thing to do is like was already mentioned, and get support help because they have their own unique way of doing some things.
If anyone is interested, I spoke to bubble support, and they said I needed to use a 3rd party file storage like AWS’s S3, which i’ve signed up for.
I am using the plugin by Pilot & Launch (Pilot & Launch Contributor Profile | Bubble) which has successfully allowed me to upload html without being sanitised.
I have two issues now:
When the file is uploaded to S3 it has the wrong metadata, and I need to set it to text/html for it to render in the browser
When the page is loaded and should show my html in an iframe, it downloads the file rather than rendering inside the iframe. This file downloads every time the page is refreshed too
Since you’re using an iframe I’m assuming you’re embedding the file on a website other than Bubble?
Since the URL changed, it looks like Bubble used to allow users to store files in their S3 bucket and now they don’t?
As for the file just downloading and not rendering…
first I’d contact the plugin support.
Without seeing your complete setup, if I were to take a guess at what the problem is, I’d say you don’t have your CORS configuration on your S3 bucket set up right. I would check that.