Add HTML to my pages using SPFX extension

john john 796 Reputation points

I want to force my modern pages to refresh each 3000 seconds >> so i develop an spfx extension >> where inside my .ts i added the following code:-


now when i add the SPFX to my site, the pages will NOT load each 3000 seconds.. so seems:-


did not have any effect.. although I have a customStyle which get applied correctly.. any advice?

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
7,135 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,041 Reputation points

    I test with this code, to facilitate testing, I changed the refresh time to 3 seconds.

    setTimeout(function (){   
    }, 3000);  

    Test result for your reference:

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.