Skip to content

lostvita/first-screen-paint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

first-screen-paint

Obtain the web page first screen paint(fsp) time automatically, non-implanted. blog

install

npm install first-screen-paint --save

Demo

cd first-screen-paint
npm install
npm run dev

Usage

// import as a module
import 'first-screen-paint'

// or add as a script
<script src="./first-screen-paint/dist/index.js"></script>

// Obtain the FSP time anywhere
if (window.$fstp) {
  $fstp.getFirstScreenTime().then((data) => {
    console.log(data)
  })
}

Api

api desc params
getFirstScreenTime obtian FSP time delay:[Number]5000(default), stop: [Bollean]true(default)
getRequestTime obtain resource time with white list format: [RegExp], delay:[Number]5000(default), stop: [Bollean]true(default)
reopen reopen listiner ele: [Element]document(default)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published