aw-watcher-web icon indicating copy to clipboard operation
aw-watcher-web copied to clipboard

getBrowserName performance improvement

Open qz4 opened this issue 3 years ago • 0 comments

Performance improvement on the getBrowserName function.

  1. app.js file size goes from 115.8KB -> 73.5KB
  2. Using String.prototype.includes() instead of Regex
  3. Avoid .exec() on many regexes (From ua-parser-js dependency)

Negative impact being that aw-watcher-web will not detect more rarely used browsers. This might be justified due to the application only being on the Firefox and Chrome addon store and the ease of adding support for a missing browser. The browser name "unknown" is used in the case of an unsupported browser.

I tested this on Firefox only.

qz4 avatar Aug 01 '22 11:08 qz4