Google Chrome and Javascript Throttling

Any and all non-support discussions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Re: Google Chrome and Javascript Throttling

Postby williamconley » Wed Apr 28, 2021 6:23 pm

Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Google Chrome and Javascript Throttling

Postby martinch » Mon May 10, 2021 2:39 am

williamconley wrote:Possibly useful:

https://www.reddit.com/r/chrome/comment ... n_version/


This looks great! I hope to test it out soon. Thanks William.
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby uselessinfoguru » Mon May 24, 2021 7:28 pm

I'm sure my signature is not correct, the server in question is on the vicibox 8.1 SVN Version:3439 DB Schema Version: 1633

I'm running into the same issue with chrome, only in this case, all the reps are using MACs... :? I'm trying the implemented audio work around first, if that doesn't work, I'll try the script, I'll post an update here for what works in this situation.

UPDATE:

So far so good... In this case, the audio work around seems to have worked.

SYSTEM SETTINGS:

Agent Hidden Browser Sound: click_quiet volume: 25
Agent Hidden Browser Sound Seconds: 20

Special Note: Thank you Matt/ViciTeam for solving this effectively and efficiently.
Last edited by uselessinfoguru on Fri May 28, 2021 9:22 pm, edited 1 time in total.
VERSION: 2.14-736a | BUILD: 200204-2336| Cluster Setup
uselessinfoguru
 
Posts: 74
Joined: Tue Jul 25, 2017 10:27 pm

Re: Google Chrome and Javascript Throttling

Postby carpenox » Mon May 24, 2021 11:00 pm

update to at least 3390 and youll have the option for silent sounds played in the background which should help with that or update to viciphone 2.1 which has a timer, both options work
Alma Linux 9.4 | SVN Version: 3889 | DB Schema Version: 1721 | Asterisk 18.21.1 | PHP8
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
GC: https://join.skype.com/ujkQ7i5lV78O | DC: https://discord.gg/DVktk6smbh
carpenox
 
Posts: 2423
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL

Re: Google Chrome and Javascript Throttling

Postby roger.milligan » Mon Oct 10, 2022 6:16 am

I note that the latest version of Chrome has a new flag #quick-intensive-throttling-after-loading

This reduces the throttling time from 5 minutes to 10 seconds! So users who have had issues with this will only get worse. Thanks Matt for the above fixes - they do the trick and will now be needed more than ever.

Quick intensive throttling after loading
For pages that are loaded when backgrounded, activates intensive throttling after 10 seconds instead of the default 5 minutes. Intensive throttling will limit wake ups, from setTimeout and setInterval tasks with a high nesting level and delayed scheduler.postTask tasks, to 1 per minute. See https://chromestatus.com/feature/5580139453743104 for more info. – Mac, Windows, Linux, ChromeOS, Android, Fuchsia, Lacros
#quick-intensive-throttling-after-loading
------------------------------------------------------------------------------------------------------
Roger Milligan
Thrive, Cape Town, South Africa.
Mobile: +27 791412325 rogerm(at)thrivedatasolutions(dot)com
roger.milligan
 
Posts: 58
Joined: Sun Jul 19, 2015 12:18 pm
Location: Cape Town, South Africa

Re: Google Chrome and Javascript Throttling

Postby mflorell » Mon Oct 10, 2022 9:51 am

Thanks for the update!

I knew it was going to get worse, but from 5 minutes to 10 seconds, damn!
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Google Chrome and Javascript Throttling

Postby mflorell » Tue Feb 21, 2023 11:25 am

We've updated the Web Browser Javascript Throttling document to include recent changes to throttling in Chrome, as well as the new "Memory Saver" and "Energy Saver" features added as default enabled in Chrome build 110:

https://www.vicidial.org/docs/WEB_BROWS ... TTLING.txt
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Google Chrome and Javascript Throttling

Postby martinch » Tue Feb 28, 2023 3:50 am

Thanks mflorell for the update. It seems like this battle with Google with never end!

I will highlight my previous post from a couple of years (this one -> http://vicidial.org/VICIDIALforum/viewt ... 98#p146534) in regards to implementing a Web Worker to bolster efforts in tackling the throttling issue. The Web Worker has wide browser support, is a lot more resilient than the "Sounds Hack / setTimeout" as that is going to annoy our agents and is subject to Google patches. It is also more resilient than the EventSource method as that relies on a on healthy and stable network conditions. The Web Worker spawns a new thread inside Chrome itself which works with ViCiDial but can operate independently when the tab is changed.

What I can do is I can log a ticket on Mantis and provide the code for you guys to try out. The more methods we can develop together, the stronger our chances battling the throttling.

Web Worker information -> https://www.w3schools.com/html/html5_webworkers.asp

Web Worker Browser support -> Image

Thanks guys,
Martin.
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby mflorell » Tue Feb 28, 2023 7:18 am

Thank you very much Martin!

A new ticket in Mantis with some example code would be greatly appreciated.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Google Chrome and Javascript Throttling

Postby martinch » Wed Mar 01, 2023 8:09 am

Cheers Matt yeah no problem.

I will also submit an enhanced version of the "Sounds Hack / setTimeout" that I have experimented with. My idea is to play a constant tone during the dialling session at 100% volume which will force the ViCiDial heartbeat to keep ticking. To achieve this, I'm proposing the following;

- Using HTML5's audio "loop" functionality.
- Generate a small sound file in Audacity that produces a constant tone of 20Hz.

This will trick Chrome into thinking it's playing sound at full pelt...however, we as humans cannot hear frequencies below 20Hz, it's too low for our puny ears to discern even with Vulcan-like hearing. I understand the hearing frequency range is different in other animals though!

I've tested this on my instance of ViCiDial and it works a treat. Less inserts into the visibility log, less processing in JavaScript...overall less for ViCiDial to do in terms of processing. This will bolster the setTimeout method to make it bulletproof. I'll submit both proposals on Mantis for you to review and give your feedback on.

Cheers,
Martin.
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby martinch » Sat Mar 04, 2023 6:30 am

martinch wrote:Cheers Matt yeah no problem.

I will also submit an enhanced version of the "Sounds Hack / setTimeout" that I have experimented with. My idea is to play a constant tone during the dialling session at 100% volume which will force the ViCiDial heartbeat to keep ticking. To achieve this, I'm proposing the following;

- Using HTML5's audio "loop" functionality.
- Generate a small sound file in Audacity that produces a constant tone of 20Hz.

This will trick Chrome into thinking it's playing sound at full pelt...however, we as humans cannot hear frequencies below 20Hz, it's too low for our puny ears to discern even with Vulcan-like hearing. I understand the hearing frequency range is different in other animals though!

I've tested this on my instance of ViCiDial and it works a treat. Less inserts into the visibility log, less processing in JavaScript...overall less for ViCiDial to do in terms of processing. This will bolster the setTimeout method to make it bulletproof. I'll submit both proposals on Mantis for you to review and give your feedback on.

Cheers,
Martin.


Ticket logged on Mantis -> http://www.vicidial.org/VICIDIALmantis/view.php?id=1448
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby martinch » Sat Mar 04, 2023 7:03 am

mflorell wrote:Thank you very much Martin!

A new ticket in Mantis with some example code would be greatly appreciated.


Thanks Matt. I've submitted the patch on Mantis for this piece -> http://www.vicidial.org/VICIDIALmantis/view.php?id=1449
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby martinch » Wed Mar 08, 2023 1:22 am

Hello guys,

I have yet another method which ditches JavaScript timers all together instead opting for the modern fetch API with a little help from PHP. It seems fetch requests are not throttled. :) Here's a taster of how it will work;

Code: Select all
heartbeat("dummy.php");

async function heartbeat(file) {
    let x = await fetch(file);

    // Generate the heartbeat
    all_refresh();

    // Recursively call the function (create a loop)
    heartbeat(file);
}


Patch will be provided for you Matt and team on Mantis for consideration. If all methods are considered and published, this would bring the number of distinct counter measures to 5 which will provide stability for a while until Google catch up.

Cheers,
Martin.
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby mflorell » Wed Mar 08, 2023 7:24 am

Thank you very much for your Javascript-Throttling-Workaround hunting Martin! :)
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Google Chrome and Javascript Throttling

Postby martinch » Wed Mar 15, 2023 3:41 pm

mflorell wrote:Thank you very much for your Javascript-Throttling-Workaround hunting Martin! :)


Thanks Matt :)

Patch submitted -> http://www.vicidial.org/VICIDIALmantis/view.php?id=1453

Code: Select all
=============================================
Chrome Counter Throttling Method (Fetch).
=============================================

Ticket Type: Add Feature.
Reporter: Martin McCarthy (martinch).
Impacted Users: ViCiDial agents using recent Google Chrome including Chromium based variants.
Priority: Medium.
Product(s) Affected: All ViCiDial versions (tested on 2.14b0.5).
Deadline: No firm deadline in place.
Time / Effort Estimate: 1 hour of development / 1 hour of QA testing.

=============================================
Description
=============================================

In the constant battle to counter Google's throttling methods in Chrome, I present the "Fetch" Agent Screen Timer. This method does not use a JavaScript timer (the very thing that Google is throttling) and uses a simple recursively looping function combined with a fetch request.

Tasks;

- Add a new option to system settings option Agent Screen Timer called "Fetch".
- Add conditional code based on new option to ViCiDial.
- Test.

If you have any queries, please reach out to me.

=============================================
End
=============================================
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby martinch » Wed May 17, 2023 1:19 pm

One interesting idea I was kicking about with regards to Chrome Throttling was having your CRM integrated right there into ViCiDial itself...in an iFrame...wondering what you think about that...if that is something that could be of use. Obviously, agents having all their sites in ViCi negates the need to leave ViCi which can stop the throttling at the source :) iFrames are so 90s though lol

A couple of examples;

Image

Image
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK

Re: Google Chrome and Javascript Throttling

Postby carpenox » Fri Jun 09, 2023 11:53 am

Alma Linux 9.4 | SVN Version: 3889 | DB Schema Version: 1721 | Asterisk 18.21.1 | PHP8
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
GC: https://join.skype.com/ujkQ7i5lV78O | DC: https://discord.gg/DVktk6smbh
carpenox
 
Posts: 2423
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 43 guests