# Uibrouter.iife.min.js Unable to load Grafana Graph (same IP, different Port)

**URL:** <https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688>\
**Category:** Dashboard\
**Tags:** uibuilder\
**Created:** [27 August 2026 15:01 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688 "2026-08-27T15:01:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [27 August 2026 15:01 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688/1 "2026-08-27T15:01:39Z")

</div>

I am trying to display a couple of Grafana graphs in a UIBUILDER webpage. I can load the graphs into a Browser if I put the link into the address bar, but they won't load in the webpage. The error in the browser shows:

`Framing '``http://<IP>:3001/``' violates the following Content Security Policy directive: "frame-src 'self' https:". The request has been blocked.`

I think I get that as the link points to a different port, the file indicated as causing the error is `uibrouter.iife.min.js`, but I can't find `frame-source` in that file, although I can see the word `strict`.

I reference the `uibrouter.iife.min.js` file in my `index.html` header

`<script defer src="../uibuilder/uibuilder.iife.min.js"></script>`  
`<script defer src="../uibuilder/utils/uibrouter.iife.min.js"></script>`  
`<script defer src="./js/index.js">`

It seems that in my SPA website, I also need this available for my `index.js`

```javascript
// ----- Start of Routing ----- //

const router = new UibRouter(routerConfig)

// ---------- Setup: Centralised Message Handling for SPA ---------- //
uibuilder.onChange("msg", handleUibMsg);

```

The SPA Message Handling is a script @Paul-Reed kindly allowed me to use.

Commenting either of these out does not help! Nothing appears to load except the Navigation Menu text.

I have looked at the Documents and the only references I can find are to Navigation Menus, or at least, that is all I can get from reading them. They do show examples of 'external template', but I don't understand. The drugs don't help!

I think that is all of the information, so the question is... How do I get a 'remote' (same IP, different Port) link/image to appear in a UIBUILDER webpage?

As usual, I am probably missing something very basic, but I don't know how to proceed!

TIA,  
Colin J

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [27 August 2026 15:38 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688/2 "2026-08-27T15:38:13Z")

</div>

OK, doing some more research using AI and referencing the Docs along [with a post](https://discourse.nodered.org/t/uibuilder-bug-fix-release-v7-6-2-bonus-improved-docs-layout/100871), it seems I need to define the `contentSecurityPolicy` in settings.js. Indeed, an enhancement was made to enable this in V7.6.1 of UIBUILDER.

I now need to find out how to add the `contentSecurityPolicy`setting for UIBUILDER in settings.js

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [27 August 2026 16:04 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688/3 "2026-08-27T16:04:06Z")

</div>

I can't believe this, after working on this all day, I have now managed to get it working! I have achieved more in the last hour or so than the previous seven!

Assembling data from AI, the referenced post, UIBUILDER V7 Docs, and trying a couple of times of editing `settings.js`, I can now see a couple of Graphs in my webpages.

So, the UIBUILDER 'script' goes into `settings.js`, just before the last curly bracket. If you put it after, Node-Red won't start!

```auto
// nodeDefaults: {
// "debug": {
// "complete": true // set the debug node to show complete msg by default
// }
// }

uibuilder: {
contentSecurityPolicy: {
"default-src": "'self' 'unsafe-inline' data: blob: https:;",
"connect-src": "'self';",
"img-src": "'self' data: blob: https:;",
"font-src": "'self' data: https:;",
"style-src": "'self' 'unsafe-inline' data: blob: https:;",
"script-src": "'self' 'unsafe-inline' 'unsafe-eval' blob: https:;",
"frame-src": "'self' https: http://<MyIP>:3001;"
        }
    }
}

```

@TotallyInformation can you check this to make sure it is OK. It was suggested by my mate Claude.

Thank you to all who read this!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [27 August 2026 19:32 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688/4 "2026-08-27T19:32:03Z")

</div>

> [@mudwalker](#):
>
> @TotallyInformation can you check this to make sure it is OK. It was suggested by my mate Claude.

You will know if it’s wrong because something won’t work. 😁 those security settings for browsers are quite sensitive.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [28 August 2026 09:23 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688/5 "2026-08-28T09:23:51Z")

</div>

I feel that we have been here before, but with the drugs I am on, my short term memory is shot. I suppose it could be the advancing years, but who knows!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 September 2026 09:24 UTC](https://discourse.nodered.org/t/uibrouter-iife-min-js-unable-to-load-grafana-graph-same-ip-different-port/101688/6 "2026-09-11T09:24:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
