Skip to content

Prevent duplicate script injection in tabbed_block plugin#42756

Merged
frenck merged 1 commit into
home-assistant:currentfrom
doomsniper09:fix/tabbed-block-duplicate-script
Dec 29, 2025
Merged

Prevent duplicate script injection in tabbed_block plugin#42756
frenck merged 1 commit into
home-assistant:currentfrom
doomsniper09:fix/tabbed-block-duplicate-script

Conversation

@doomsniper09
Copy link
Copy Markdown
Contributor

The tabbed_block plugin was injecting the same JavaScript code every time a tabbed block was rendered. On pages with multiple tabbed blocks, this resulted in duplicate script tags and function definitions.

This change uses a context flag to ensure the script is only included once per page, reducing page size and avoiding redundant code.

Proposed change

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

The tabbed_block plugin was injecting the same JavaScript code every time a tabbed block was rendered. On pages with multiple tabbed blocks, this resulted in duplicate script tags and function definitions.

This change uses a context flag to ensure the script is only included once per page, reducing page size and avoiding redundant code.
@home-assistant home-assistant Bot added the current This PR goes into the current branch label Dec 28, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 28, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 4d8b078
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/695121284156c10008ce8532
😎 Deploy Preview https://deploy-preview-42756--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @doomsniper09 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck frenck merged commit b96e24c into home-assistant:current Dec 29, 2025
7 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

current This PR goes into the current branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants