You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi All,
I have to build a small plugin for Jira/Confluence in order to inject JS.
I am aware about Web Resource module type that allows to inject JS depending the different context of the application. It allows to inject a <script> based on an aggregate of JS source from the Application, where the declared dependencies are analysed in order to have the correct JS.
The generated html looks like
{code:html}<script type="text/javascript" src="/confluence/s/71095c56c641f2c4a4f189b9dfcd7a38-CDN/en_US/8100/5084f018d64a97dc638ca9a178856f851ea353ff/3.1.1/_/download/batch/confluence.extra.livesearch:livesearch-macro-web-resources/confluence.extra.livesearch:livesearch-macro-web-resources.js?locale=en-US" data-wrm-key="confluence.extra.livesearch:livesearch-macro-web-resources" data-wrm-batch-type="resource"></script>{code}
But, how to process if a part of this injected JS has external dependencies not stored on the application. In final, I expect to have
{code:html}
<script language="JavaScript" src="https://other.copany.com/js/SomeLibrarie.js"></script> {code}
Any idea ?
Thanks
This is not possible directly to add external web resources. But there are some workaround that you can use,
Hopefully this helps.
Hi DPK J,
The solution could be a possibility if the downloaded resource is cached with some epxiration age, but I did not have yet find such usage in documentation.
The JS resource is a large one, and it would be not aceptable to reload it all the time without benefit of Browser cache.
I should test it as soon as the implementation is confirmed.
V.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.