Heya, I got into a problem where I want to debug. There’s an error saying “This page is slowing down firefox. To speed up your browser, stop this page”
At first, the game runs smoothly but after it enters the screen with animated background, the browser crashes and I couldn’t click on anything.
: Which browser? Firefox, chrome, Microsoft Edge (I’ve tried them all, and it has the same results)
What steps did you already try to fix it, if any? I removed extensions, tried new browser, went to private browser and it still couldn’t run.
Browsers usually say that when there’s an infinite loop causing the tab to run at max CPU. Or if it uses too much memory but it’s probably an infinite loop.
Best way to find out is to get back to your precious version of the code that didn’t have this issue and then try to figure our which of your recent changes make it happen, or generally check what you’ve changed between the two versions and see if anything looks wrong. This is easier to do if using version control like git or others obviously and that’s why it’s recommended to always use version control with frequent commits.
There’s also the possibility of opening devtools and trying to quickly press the pause button in the source tab when the page starts to slow down but it’s hard to get it to work as ideally you want it to pause in the infinite loop to then investigate where it keeps getting stuck.
But generally if this started happening it means something in your game is causing it so look at what you’ve changed recently to find the potential cause.
Infinite loops are inherently hard to debug otherwise since they break the browser so there’s no other magic trick really
Also since you said “screen with animated backgrounds” are they somehow huge files that are just killing the browser’s memory when trying to display them?