I had the same issue with my S4. I also turned off all the auto display settings and it would still just haphazardly dim and brighten with no rhyme or reason. Primarily in Chrome, but also tested it in other browsers, SMemo and other apps. I triple-checked the display settings, turned off eye tracker, did a complete wipe/ hard reset, all to no avail.
Originally I was worried I had a defective unit. However now I believe it?s a pervasive issue with S4?s because I?ve exchanged 2 so far (on my 3rd), from 3 different cities (trying to avoid bad batch), and unfortunately the issue has been present in all 3.