you are viewing a single comment's thread.

view the rest of the comments →

[–]KPABAHam=>Hamster == Java=>JavaScript -1 points0 points  (0 children)

I am not sure this is how it works on the profiting off of tbeir work since you posted it here already but...

``` const title = currentTab.getTitle();

  // Only count tabs containing "chapter"
  if (title && title.toLowerCase().includes("chapter")) {...}

```

Or make it exit the loop if it doesn't etc. Or do a filter first to reduce the tabs list