Forum Discussion
How to insert a custom Script inside a Modern WebSite page ?
Roberto Ialino out-of-the-box this isn't possible as Microsoft have locked it down so that sites don't break when Microsoft make any changes. You might be able to achive this with SPFX but someone like ganeshsanap would have to answer that as I'm not permitted to use SPFx at my company.
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
- ganeshsanapOct 13, 2022MVP
Thanks for the mention RobElliott
Roberto Ialino You can inject custom JavaScript/CSS on modern pages using SPFx. Check my answer for more information at: Running modern 2022 native Web Components in Microsoft365/SharePoint Online
Note: DOM manipulation & CSS customizations are not recommended by Microsoft and some of your customization may break if Microsoft changes HTML element id/classes in new release updates.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- Roberto IalinoOct 13, 2022Copper ContributorThanks a lot both !!!
Robbo