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

Chrome page crashes "Aw, Snap. Error 5" after loading too many elements in a page #3

Open
DeborahAnn032 opened this issue May 4, 2023 · 7 comments

Comments

@DeborahAnn032
Copy link

I am on a MacBook Pro M2 with Google Chrome. O am scrolling through a lot of Facebook profiles and I've noticed that after a while the page crashes saying "Aw, Snap". I've tried to increase the browser default cache size but that didn't fix the issue because it's not the problem.
The issue could be in the structure limits of the Blink engine.
So, I thought "what if I delete some of the "upper" elements while I go through it"? That should remove some "weight".

    var profiles = document.querySelectorAll('tagName');
    for(var i=0;i<profiles.length;i++) {
    profiles[i].remove();
    }

As a matter of fact, by doing this I am able to go farther with the scrolling (lazy loading). But a still after a while it crashes.

The new elements are added, and therefore rendered, while scrolling (lazy loading).
I thought: what if I prevent the new elements to be rendered?
Basically I would need to set:

element.style.display = 'none';
but I would need to do this before the element is added, otherwise if I do it after it would be still rendered.
So, I guess I would need to find the script that get the element from server and I would need to make the appropriate changes before it's added.

What I could do?

@floriandiud
Copy link
Owner

floriandiud commented May 5, 2023

Hello @DeborahAnn032 ,

Thanks for this message.
If you have performance issues, the first things I would do is to close the Developer Console once the script is pasted/submitted. The JS will still be active but you avoid all the "debug layers" that the Developer Console adds.

If this is not enough, you can try to add a "visibility:hidden" style to the list of elements.

Screenshot 2023-05-05 at 09 21 44

Screenshot 2023-05-05 at 09 21 49

Add a "div" at the end to target the children.

Screenshot 2023-05-05 at 09 27 35

And then you close the Developer Console (without reloading the page).

Tell me if this helps.

@DeborahAnn032
Copy link
Author

Hello @floriandiud,
thanks so much for replying.
Your guide was very detailed but sadly it still crashes after a while (usually after 6k elements).
Since changing the visibility to hidden didn't work, would be possible to trigger the event that loads the new data, intercept it so that we can prevent to add the data in the div container?
I am asking because I came across a chrome extension (not sure if I can mention it here) that I think does exactly this.

@theninh
Copy link

theninh commented Oct 14, 2023

I have same issues, @DeborahAnn032 What is your solution, can you show me?
Thank you so much!!!!

@DhruvAthaide
Copy link

@DeborahAnn032 Could you give me the Chrome extension please as I am also facing the same issue!

@paboum
Copy link

paboum commented Apr 7, 2024

If you have performance issues, the first things I would do is to close the Developer Console once the script is pasted/submitted. The JS will still be active but you avoid all the "debug layers" that the Developer Console adds.

What performance issues are you talking about? The script just crashes chrome after some 6 or 8k results are fetched (personally I use great xdotool for scrolling page down overnight). Either lower your scripts memory footpring by using optimal algorithms, or consult with chrome dev team on how to increase memory limit for running the script, or perhaps there is a bug in facebook's code and then it would be prudent to report that to facebook (they should in fact allow downloading these records via csv file, saving energy on both client and server side). There is simply no scenario in which user has done something wrong here and should work around the three possible culprits mentioned.

@DhruvAthaide
Copy link

If you have performance issues, the first things I would do is to close the Developer Console once the script is pasted/submitted. The JS will still be active but you avoid all the "debug layers" that the Developer Console adds.

What performance issues are you talking about? The script just crashes chrome after some 6 or 8k results are fetched (personally I use great xdotool for scrolling page down overnight). Either lower your scripts memory footpring by using optimal algorithms, or consult with chrome dev team on how to increase memory limit for running the script, or perhaps there is a bug in facebook's code and then it would be prudent to report that to facebook (they should in fact allow downloading these records via csv file, saving energy on both client and server side). There is simply no scenario in which user has done something wrong here and should work around the three possible culprits mentioned.

I think the issue is that everytime you keep on scrolling down the group member list, Facebook keeps on loading the group members that haven't been loaded in and probably add them to the page and after scrolling for about 2 - 3 hours chrome cannot get enough memory to keep on loading new members and sometimes might crash or just slow down. It's a Facebook issue but it might be solved if you have enough RAM on your machine to assign to chrome.

@paboum
Copy link

paboum commented Apr 7, 2024

If that's the case, then I see possible approaches:

  • The script could modify facebook mechanism and unload redundant data after the users data has been scraped
  • The documentation should rougly specify how many users can be loaded with given memory and ask the user to be careful
  • The script should somehow learn about free memory and stop operating (block scrolling down further) after the limit
  • I have literally 109 GiB of RAM free on my system, I'd expect some runtime flags, ulimit settings etc. could help to make the most of it, and they should be documented here

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

5 participants