question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Large amount of classes locks up getCombinations

See original GitHub issue

I’m seeing an issue where a website with a large amount of classes on the <html> element causes the getCombinations to lock up on the following code:

for (i = k = 0, ref = items.length - 1; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) {
  for (j = l = 0, ref1 = result.length - 1; 0 <= ref1 ? l <= ref1 : l >= ref1; j = 0 <= ref1 ? ++l : --l) {
    result.push(result[j].concat(items[i]));
  }
}

In my case, I have 47 classes that are returned by getAllSelectors, which I assume are generated by the UI libraries running on the website.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vishaltelangrecommented, May 31, 2016

My browser was also running out of memory when I tried to grab the selectors on nytimes website.

Until this is fixed, I am getting rid of the classes added on HTML tag with the following condition:

// ...
CssSelectorGenerator.prototype.getClassSelectors = function(element) {
      var class_string, item, result;
      result = [];

      if (element.tagName === 'HTML') {
        return result;
      }

     // ...
0reactions
fczbkkcommented, Aug 21, 2021

I have added maxCombinations and maxCandidates performance options. These should help to deal with the sites that, for example, use large number of classnames on elements.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Summer Reset: Combinations for Thousands of School ...
July 09--JANESVILLE, WI -- It's summer, and that means changing the combinations for 8,000 lockers at Janesville middle and high schools.
Read more >
Get combinations in C rather than in Python itertools ...
In Python the itertools.combinations works perfectly fine for a view combinations but due to the large amount of combinations it is not time ......
Read more >
Break open any Master Combo Lock in 8 tries or less! - YouTube
Crack open any Master combination lock in 8 combinations or less! This online tool and new technique will allow you to learn the...
Read more >
Master Lock Combination Recovery - - Dreamshire
An easy way to perform a Master Lock combination recovery using simple trial and error in less than 15 minutes.
Read more >
Easy Permutations and Combinations - BetterExplained
Permutations are for lists (order matters) and combinations are for groups (order doesn't matter). You know, a "combination lock" should really be called...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found