Rutuj-Runwal / RR-Adblocker

A browser extension that blocks ads and trackers to make your web surfing faster and safer.
https://rutuj-runwal.github.io/RRAdblocker/
GNU General Public License v3.0
31 stars 31 forks source link

Constant Reassignment Error #8

Closed swarajp486 closed 2 years ago

swarajp486 commented 2 years ago

In background.js, the code at line number 88makes the if statement immediately following it unsuable. As the urlData variable is declared as constant, it cannot be updated inside the if statement which will throw an error and abort the service worker when the if statement holds true and the statement is reached.

const urlData = text.split("\n");
if(urlData.length>=4950){
     urlData = urlData.slice(0,4949);
 }
Rutuj-Runwal commented 2 years ago

Thanks for pointing it out. This is a very big error as it makes the whole code vulnerable to constant reassignment. Great work. You can proceed with a fix.

swarajp486 commented 2 years ago

Thanks for pointing it out. This is a very big error as it makes the whole code vulnerable to constant reassignment. Great work. You can proceed with a fix.

Yes sure.