Allow plugins to inject javascript in all pages #4689

Closed
opened 2025-12-29 19:19:32 +01:00 by adam · 4 comments
Owner

Originally created by @fabi125 on GitHub (Mar 19, 2021).

NetBox version

v2.10.6

Feature type

New functionality

Proposed functionality

Currently the types of pages plugins can add content to are limited. I'm proposing to let plugins add javascript in all pages.

Use case

We want to use this to add little snippets like pressing / to jump to the searchbox.

Database changes

None (I think)

External dependencies

None

Originally created by @fabi125 on GitHub (Mar 19, 2021). ### NetBox version v2.10.6 ### Feature type New functionality ### Proposed functionality Currently the types of pages plugins can add content to are limited. I'm proposing to let plugins add javascript in all pages. ### Use case We want to use this to add little snippets like pressing `/` to jump to the searchbox. ### Database changes None (I think) ### External dependencies None
adam added the type: feature label 2025-12-29 19:19:32 +01:00
adam closed this issue 2025-12-29 19:19:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 19, 2021):

My immediate concern with this is that AFAIK there's no feasible way to "scope" the Javascript to avoid it interfering with core or vice versa.

Beyond that though, this should already be doable using template extensions: Your plugin can embed a Javascript inclusion tag on any of the extendable pages.

@jeremystretch commented on GitHub (Mar 19, 2021): My immediate concern with this is that AFAIK there's no feasible way to "scope" the Javascript to avoid it interfering with core or vice versa. Beyond that though, this should already be doable using template extensions: Your plugin can embed a Javascript inclusion tag on any of the extendable pages.
Author
Owner

@fabi125 commented on GitHub (Mar 19, 2021):

That's fair. I guess the biggest blocker in doing that for us would be to allow plugins to extend the main/home page.

@fabi125 commented on GitHub (Mar 19, 2021): That's fair. I guess the biggest blocker in doing that for us would be to allow plugins to extend the main/home page.
Author
Owner

@jeremystretch commented on GitHub (Mar 19, 2021):

We could potentially look at doing that for v2.12. There's already a huge UI refresh underway for v2.11 as it is, and I'd prefer to avoid introducing any additional change during this time if it can be avoided.

@jeremystretch commented on GitHub (Mar 19, 2021): We could potentially look at doing that for v2.12. There's already a huge UI refresh underway for v2.11 as it is, and I'd prefer to avoid introducing any additional change during this time if it can be avoided.
Author
Owner

@jeremystretch commented on GitHub (Apr 21, 2021):

Closing this out at least until v2.12 is released, at which point we can re-evaluate options.

@jeremystretch commented on GitHub (Apr 21, 2021): Closing this out at least until v2.12 is released, at which point we can re-evaluate options.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4689