Add HTML to my pages using SPFX extension

john john 986 Reputation points
2021-03-11T11:55:32.697+00:00

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:-

76792-coding.png

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

76811-head2.png

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

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

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2021-03-12T02:10:39.817+00:00

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

    setTimeout(function (){   
    	window.location.reload();  
    }, 3000);  
    

    Test result for your reference:
    76937-test83.gif


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.