Bug 1842690 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Confirmed via devtools that the page is not overflow-y:hidden in Chrome, meaning the site serves different content (or content with script that sets up different styles) to Chrome vs. Firefox.

After further investigation I have discovered the following:

 * The overflow-y:hidden style is set from script that appears to be a minified version of [jquery.nicescroll](https://github.com/inuyaksa/jquery.nicescroll), a jquery plugin whose purpose seems to be to customize the appearance of scrollbars and perform other scrolling customizations
 * The version of jquery.nicescroll the site appears to be using is 3.4.0, which is 10 years old
 * The logic to set overflow-y:hidden is in a branch that's [conditioned on](https://github.com/inuyaksa/jquery.nicescroll/blob/e39cc9a391838b16b9b97256656bbe236f33f54b/jquery.nicescroll.js#L701) a variable `cap.cantouch` which is true in Chrome but false in Firefox (note: I'm linking to the corresponding non-minified source of version 3.4.0 for readability).
 * The relevant logic for setting `cap.cantouch` in turn looks like this:
   ```js
   //## Check Chrome desktop with touch support
       if (cap.cantouch&&cap.ischrome&&!cap.isios&&!cap.isandroid) {
         this.istouchcapable = true;
         cap.cantouch = false;  // parse normal desktop events
       }    
   
   //## Firefox 18 nightly build (desktop) false positive (or desktop with touch support)
       if (cap.cantouch&&cap.ismozilla&&!cap.isios) {
         this.istouchcapable = true;
         cap.cantouch = false;  // parse normal desktop events
       } 
   ```
    Note the Chrome block has a check for Android but the Firefox block does not; the code does not seem to consider Firefox for Android at all.
Confirmed via devtools that the page is not overflow-y:hidden in Chrome, meaning the site serves different content (or content with script that sets up different styles) to Chrome vs. Firefox.

After further investigation I have discovered the following:

 * The overflow-y:hidden style is set from script that appears to be a minified version of [jquery.nicescroll](https://github.com/inuyaksa/jquery.nicescroll), a jquery plugin whose purpose seems to be to customize the appearance of scrollbars and perform other scrolling customizations
 * The version of jquery.nicescroll the site appears to be using is 3.4.0, which is 10 years old
 * The logic to set overflow-y:hidden is in a branch that's [conditioned on](https://github.com/inuyaksa/jquery.nicescroll/blob/e39cc9a391838b16b9b97256656bbe236f33f54b/jquery.nicescroll.js#L701) a variable `cap.cantouch` which is true in Chrome but false in Firefox (note: I'm linking to the corresponding non-minified source of version 3.4.0 for readability).
 * The [relevant logic](https://github.com/inuyaksa/jquery.nicescroll/blob/e39cc9a391838b16b9b97256656bbe236f33f54b/jquery.nicescroll.js#L334-L344) for setting `cap.cantouch` in turn looks like this:
   ```js
   //## Check Chrome desktop with touch support
       if (cap.cantouch&&cap.ischrome&&!cap.isios&&!cap.isandroid) {
         this.istouchcapable = true;
         cap.cantouch = false;  // parse normal desktop events
       }    
   
   //## Firefox 18 nightly build (desktop) false positive (or desktop with touch support)
       if (cap.cantouch&&cap.ismozilla&&!cap.isios) {
         this.istouchcapable = true;
         cap.cantouch = false;  // parse normal desktop events
       } 
   ```
    Note the Chrome block has a check for Android but the Firefox block does not; the code does not seem to consider Firefox for Android at all.

Back to Bug 1842690 Comment 4