Enable autoplay-policy flag for audio in Chrome - javascript

TLDR; How do I enable the autoplay-policy flag in >= Chrome 62? The autoplay problem has been thoroughly discussed, but in this question I want to edit the settings for my own browser to run a browser extension game that can play its own sounds in a "kiosk".
Issue; I am building a chrome extension that plays a game on top of web pages. I am now creating the demo mode that automatically goes to new urls and launches the game so viewers can watch it in galleries, etc. However, because this is an automated script (users watch it passively) and these web pages are random (so do not have a high Media Engagement Index (MEI) chrome://media-engagement/) my extension sounds are suspended chrome://media-internals/:
I have looked at:
Javascript but their policy says a user has to interact with the domain (which is not possible)
Increasing the domain's MEI score (again, not possible)
Setting the "Developer Switch" at chrome://flags/#autoplay-policy to allow autoplay (but it seems this page no longer works as of at least Chrome 76).
Picture of game for context:

I temporarily "solved" this by using Chrome Canary v78 with start up flags found in this SO question description. In Terminal (Mac)...
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --autoplay-policy=no-user-gesture-required

Related

Is there a way to play audio in the browser without being user initiated (for kiosk-like usage)?

I am building a jukebox-like javascript application that runs in the browser. This application will run on a dedicated machine in an exhibition.
It will have to run continuously for 8 hours. At certain moments it will navigate to a different page (or reload current page with different search parameters).
It needs to play audio on all pages. But audio in the browser can only play user-initiated. Is there a way to bypass the user-initiation requirement in chrome or safari? Again, this will be a dedicated machine, so browser flags etc are an option.
If this is not possible in chrome or safari, what would be another solution/environment that can do this?
Your are in total control of the running browser (because you start the kiosk). So you can start the browser without the usual security behavior that prevent auto play.
For example if you are using Google chrome you can start it with chrome.exe --autoplay-policy=no-user-gesture-required

Enable audio autoplay in Chrome for web apps installed on the user's Android desktop

I have developed a progressive web app that can be run in kiosk mode / standalone from the user's Android desktop.
On websites, Chrome's Autoplay policy prevents me from playing media programatically if there was no prior user interaction with the website. But this also applies to the PWA.
Is there a flag for the manifest or some other solution to allow playback without user gesture in kiosk mode?
(I don't understand why someone wants to prohibit autoplay of media in a PWA that the user has explicitly installed on the desktop.)
Finally I can confirm it has been a bug, which is fixed in Chrome version 76.
https://bugs.chromium.org/p/chromium/issues/detail?id=977666
Now it works as expected.
Mohre is quite right, autoplay - or in my case creation of audioContext - is allowed without user-gesture when the PWA is installed.
However, I believe I've discovered a short-fall in Chrome's Trusted Web Activity implementation ...
Since a TWA is a PWA installed from the Play Store, I'd expected the same exemption from the user-gesture rule, but this is not the case.
If you list your PWA in the Play Store - by creating and publishing a TWA - user-gesture is once again required :(

Chrome extension's chrome.history not synced across devices?

Trying to write a chrome extension using the chrome.history api. I'm seeing the history reported by chrome.history doesn't contain links visited on other devices (although those links do appear in the chrome://history page on the same device).
Is there an alternative to chrome.history I could use? Is there something else than an extension I could build that could access the full cross device history?
Or is there a reason for the discrepancy between chrome://history and chrome.history?
My end goal would be to highlight links that have been visited cross devices on current pages.
Thanks for any help!
You can check out this answer on Super User which
Reset Sync by going to the Google Dashboard.
Log out of Chrome on all your devices (PC, Mac, smartphone, etc)
Quit Chrome (kill Chrome process if necessary)
Run Chrome again and you should be asked to sign in to your account.
Once all accounts are signed in, the history should sync across all devices
This will re-sync all your devices.
By the way, extensions usually are synced to all devices if users enable the feature, and this means that your app will still show the visited links since it will have access to the device it's installed on's history.
As for the synced data, not event the Chrome browser itself can highlight the data as visited. Google.com usually highlights visited sites, but I just checked my history and the sites I visited on other sites aren't showing.
To solve your issue, you can have users create Premium accounts that gives them access to cross browser link marking. This of course has to be implemented by you.

Flash On Chrome OS

I have an Chrome app for Chrome OS that lets you run SWF files offline. The problem is when I use
<object data="flashFile.swf"></object>
It says that flash is blocked. I went to flash section in my settings and I see the apps that can and/or can't use flash but can't seem to be able to enable flash for my app. It also says it's enforced by an extension but I have no idea which one. Any suggestions?
(the picture below is a screenshot of the problem I am having)
I have a simple trick that will bring up an alert asking the user to allow flash on the website: Enable Flash Player
This is guaranteed to work on Chrome, and works on Chrome OS but I'm not sure of other browsers or OSes, anyway, hope this helps. I myself have experienced the annoyances of the new default settings; they make it much harder to run flash!
After all this time I finally figured it out. In order to use flash in a chrome app you must copy the apps id, go to settings --> content settings --> flash and click the "add" button next to "allow" and then paste the apps id as the site.

Chrome extension crashes due to garbage collector not starting the cleanup

Chrome Version : 48.0.2564.109 m on Windows 7
We have a Chrome Extension developed for our project.
The extension within it has a video element the source of which is the stream selected from the "chrome.desktopCapture.chooseDesktopMedia". The image for every 500ms is captured as webp from the video played and sent back to the host application via long lived connections.
What we notice is that this extension is crashing after a brief usage in time (sometimes at 5mins sometimes at 30mins). Profiling the extension we see the Heap memory constant at ~2.6MB throughout until the extension getting crashed.
One odd behavior that we noticed is that clicking the "Collect Garbage" button in the Timeline tab of the Developers tool for the extension is helping the extension to run for longer period without getting crashed.
Questions :
1. Is there any existing issue with Google Chrome browser extension's garbage collection not getting triggered until it is manually started ?
2. By any means is it possible to kick start this garbage collection process from the extension's

Categories