Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue. #16

Open
naveen305 opened this issue Nov 5, 2015 · 5 comments

Comments

@naveen305
Copy link

Hi Team,

am getting this issue 'A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.' and css polyfill is not working

@naveen305
Copy link
Author

Hi Team,

am getting this issue 'A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.' and css polyfill is not working

@oslego
Copy link
Member

oslego commented Nov 25, 2015

Hi, @naveen305!

I briefly checked the included examples in the /demos folder with Firefox on Mac (browser which does not support CSS Shapes natively) and there are no errors.

Are you certain that the polyfill is causing the hang? Please provide a reduced test case for inspection.

Also, note that this polyfill is not being actively maintained.

@naveen305
Copy link
Author

Hi @oslego Yes Script is busy in Mozilla and Internet Explorer in Windows

@Landerson352
Copy link

This may help -- exceedingly large stylesheets can cause the RegEx matching to take a very long time.
https://github.com/adobe-webplatform/css-shapes-polyfill/blob/master/src/style-polyfill.js#L165

Might be a common issue with third party libraries or files containing large data URIs. (TypeKit was the culprit in my case, at over 167K characters. You could log yours and see where it goes awry.) A simple fix is to wrap the while loop in a condition to skip stylesheets that are over a certain length. I chose 20,000 characters and the problem was resolved.

@oslego
Copy link
Member

oslego commented Mar 6, 2016

Thank you, @Landerson352! That may be a good workaround.

Going forward, I do not recommend people use this polyfill as it is no longer maintained. Instead, I recommend using Feature Queries to detect support for CSS Shapes and use the native implementation instead. It will be much faster for the users that have it and prevent bad performance for users who don't.

Here's a usage example:

@supports ( shape-outside: circle() ) or ( -webkit-shape-outside: circle() ){
  .element {
    -webkit-shape-outside: circle();
    shape-outside: circle();
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants