FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

Custom script injection.

Open Almas-Ali opened this issue 1 year ago • 2 comments

External script tags like Google Analytics, Adsense etc other tags require to inject on html page. How can we handle this? Currently we don't have any way to handle this thing.

In my opinion, we can create some additional components to handle each specific tags. Let me know @samuelcolvin, if anything else we can perform for this task.

Almas-Ali avatar Dec 17 '23 18:12 Almas-Ali

You can override the prebuilt_html method and add your custom html

shroominic avatar Dec 17 '23 19:12 shroominic

Overlaps with https://github.com/pydantic/FastUI/issues/19#issuecomment-1847059980.

I think we should add:

  • support for adding more scripts in the prebuilt_html method as suggested by @shroominic
  • a RawHtml component that let's you both render some raw HTML and execute arbitrary JS, e.g. you could call a method exported by the scripts you loaded via prebuilt_html

samuelcolvin avatar Dec 17 '23 19:12 samuelcolvin