Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

live edit javascript in html macro

Andrew Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 1, 2018

I want to create a simple web app embedded in a Confluence page that can modify page attachments. I have my code in a html macro. The devil is in the details with the API calls, so I would like something like codepen, jsbin, or jsfiddle with live-updating interactive code. I am not allowed to whitelist CORS requests from any of the services I just mentioned (or any other "external" server).

What is the best way to achieve this interactive development environment so all AJAX calls come from my internal Confluence server and avoid CORS blockage?

1 answer

0 votes
James Richards
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 27, 2018

Hi Andrew,

Interesting question. CORS issues are browser based not server based - so it's kinda hard to work out a solution. It sounds like you want to have externally hosted code in a live editor environment - so you can edit the code and then test straight away locally.

So, you could run an outgoing proxy that takes URLs for an internal address and context path and changes it to an external path.

Otherwise, we use a browser plugin called Tampermonkey which allows for live updating of external Javascript code we host in Bitbucket. It runs locally on the browser.

I'd have to really see the configuration more and try and get my head around what's happening to understand the network topology to find a valid solution.

Can you give some more specific details or example?

Thanks,
James.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events