0

I have a fairly CPU-intensive script which, when run, freezes the whole page for a while, so that it can't be scrolled or clicked, etc. I would gladly sacrifice performance for a more smooth experience.

Also, in my case, this script is a part of Google Chrome extension.

Is it possible to make a script that freezes the page run in background, without interrupting user interaction with the page?

2

1 Answer 1

2

Maybe web workers are of interest.

It would be best to put CPU-intensive task into a worker, which does its job in the background. Another solution is to cut your code into pieces, load them asynchronously and execute them one after another.

http://blog.typekit.com/2011/05/25/loading-typekit-fonts-asynchronously/

Sign up to request clarification or add additional context in comments.

1 Comment

The uncertain tone of your answer makes this more of a comment.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.