integrations icon indicating copy to clipboard operation
integrations copied to clipboard

Fix Front script injection

Open dugjason opened this issue 1 month ago • 7 comments

Fixes script injection issue. The script now appends to the <body> element as recommended by Front, and a duplicate appendChild call has been removed.

Refer to Front docs https://help.front.com/en/articles/2049#install_front_chat_on_your_website

dugjason avatar Nov 18 '25 01:11 dugjason

⚠️ No Changeset found

Latest commit: 1461580b648810b2660aa2ce6e8d756cfb4da17a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 18 '25 01:11 changeset-bot[bot]

Open in StackBlitz

bun add https://pkg.pr.new/GitbookIO/integrations/@gitbook/api@1054

commit: 1461580

pkg-pr-new[bot] avatar Nov 18 '25 01:11 pkg-pr-new[bot]

:point_down: Not sure what I can do about that failing Check integrations check (looks like it wants 1Password access?)

dugjason avatar Nov 18 '25 01:11 dugjason

Hi @dugjason

Thanks for investigating this with us! And thanks for starting this PR. I’ve tested this out, but it’s still not working.

After debugging a little more, it looks like it’s coming from the color-scheme set from the actual front widget.

It’s currently injecting normal, which for some reason isn’t respecting the inherited color scheme set on the page.

It looks like updating it to light dark (allowing both color schemes to go through) fixes the problem. Is this something you’d be able to look at with your product team?

https://github.com/user-attachments/assets/a324d61f-c0ba-428d-865c-2fba9cf263b1

addisonschultz avatar Nov 18 '25 09:11 addisonschultz

Good find - thanks @addisonschultz I'll share with our design engineers.

That being said - the way the chat widget is currently implemented (loading in the <head> rather than towards the bottom of <body>) can cause various other issues. I would still advise we implement this if we can (unsure what to do about that failing CI check)

dugjason avatar Nov 18 '25 19:11 dugjason

@dugjason yes - thanks again for making this PR to fix the script injection. The 1password check is an ongoing issue we have from external PRs, I’ve verified the changes are valid and it’s good to go since the other checks are passing.

I will leave this PR open for now, in case we have a resolution from the product team soon? If we need to make any additional changes here?

addisonschultz avatar Nov 19 '25 00:11 addisonschultz

Thanks Addison - sounds like a plan. We'll get back to you as we have news

dugjason avatar Nov 19 '25 20:11 dugjason