Skip to content

Add IntegrationHeadInjector trait for head script injection#239

Draft
aram356 wants to merge 1 commit intofeature/cert-verification-port-handlingfrom
feature/integration-head-injector
Draft

Add IntegrationHeadInjector trait for head script injection#239
aram356 wants to merge 1 commit intofeature/cert-verification-port-handlingfrom
feature/integration-head-injector

Conversation

@aram356
Copy link
Collaborator

@aram356 aram356 commented Feb 5, 2026

Summary

  • Adds IntegrationHeadInjector trait allowing integrations to inject HTML snippets into <head>
  • Adds with_head_injector() builder method to IntegrationRegistrationBuilder
  • Adds head_inserts() method to IntegrationRegistry to collect all injector snippets
  • Updates html_processor to inject integration head inserts after the TSJS bundle

This enables integrations (like the upcoming GAM interceptor) to inject configuration scripts into the document head without modifying the main TSJS bundle.

Test plan

  • Verify cargo check passes
  • Verify cargo test -p trusted-server-common passes
  • Verify HTML processing still injects TSJS bundle correctly
  • Integration head inserts appear after TSJS bundle in <head>

Dependencies

Closes #247
Related to #179

- Add `IntegrationHeadInjector` trait allowing integrations to inject HTML into <head>
- Add `with_head_injector()` builder method to IntegrationRegistrationBuilder
- Add `head_inserts()` method to IntegrationRegistry to collect all injector snippets
- Update html_processor to inject integration head inserts after TSJS bundle

This enables integrations like GAM to inject configuration scripts into the
document head without modifying the main TSJS bundle.
@aram356 aram356 self-assigned this Feb 5, 2026
@aram356 aram356 marked this pull request as draft February 5, 2026 18:05
@aram356 aram356 added enhancement New feature or request and removed enhancement New feature or request labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant