Why Ext.webKitVersion = 0 on Safari 10.11.1 and Google Chrome 59 and Firefox 54.0?

I am using Ext JS 6.5 . I am reading: http://docs.sencha.com/extjs/6.5.0/modern/Ext.html#property-webKitVersion

When I use script

console.log(Ext.isWebKit);

Result on Google Chrome, Safari is true. Result on Firefox is false.

I use script

console.log(Ext.webKitVersion);

The result is 0. Is it means Safari, Chrome, Firefox doesn’t use WebKit?

Question: Why Ext.webKitVersion = 0 on Safari 10.11.1 and Google Chrome 59 and Firefox 54.0? Is it a bug?


Source: stackoverflow-javascript

Javascript XHR request throttled on background tab on mobile – solution?

Would like some assumption validation and opinions on solutions to a js xhr throttling problem I seem to be running into on Chrome on Android when the phone screen is off (browser tab is in background mode).

My use case is:

  • Phone has focus on Chrome browser tab but is asleep (screen off)
  • JS Webworker has a setInterval call which sends a msg to the main JS thread ever 10 seconds.
  • Main JS thread, upon receipt of web worker msg, issues an XHR request to get a file.

Behavior:

  • Files are queried for and received by the main thread for a period of time (5 min?) after the phone’s screen is off
  • At some point, file XHR requests begin to fail.

I’m seeing (from tests and reading) that the main javascript thread is throttling (and probably queueing up) xhr requests after X minutes. Can someone confirm this behavior and ideally point to documentation on what X minutes is and what actual behavior is?

I believe that switching the XHR request into the Webworker will solve my problem. So instead of the Webworker being only the timer that tells the main thread to make an XHR request, the Webworker actually makes the XHR request itself every 10 seconds and then sends the file in a msg to the main thread. Can someone confirm this approach will work?

Kind of a big code change so want to source some opinions before doing it. Thank you.


chrome v56.0.2924.87
android v7.1.1


Source: stackoverflow-javascript

Chrome browser automatically scrolling down the content (when nobody asked him)

We have rich page where we have one little block with dynamic content. Everything worked just fine until recently.

Now Chrome browser somehow “capture” the one div on the page and scroll down the whole content. It’s hard to explain in words, but much easier to demonstrate.

Here is test page. Just open it in Chrome, and scroll a little bit down so the one of the blue boxes will be on the very top border of viewport. You will see that all content (numbers 1,2,3..) is scrolling by itself when the blue box stays on same place.

It may looks logical in this simple example, but consider that the dynamic block is only one of many blocks on the page and there’s no reason to scroll the whole content because something changing inside the block.

<html>
<body>

1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> setInterval(function () { var e = document.createElement('div'); e.setAttribute("style", "border:solid 2px blue;width:100px;height:20px"); var x = document.getElementById('x'); x.insertBefore(e, x.childNodes.length?x.childNodes[0]:null); }, 1000); </body> </html>

We just discovered this Chrome weird behavoir this week. The code worked fine for last 6 months, so I think it’s something new that Chrome made. All other browsers works fine.


Source: stackoverflow-javascript