My question is similar to this one:
How to make audio autoplay on chrome
...although most of the answers on that fail today or rely on tricks that will inevitably be fixed in the future. However, in my scenario, I have an additional advantage - I only need this to work on one specific machine on a specific page (just an auto-refreshing dashboard page), so I'm open to command line parameters or even other browsers that might allow me to override autoplay policies.
There's also this answer:
Chrome Autoplay Policy - Chrome 76
...and someone suggested this:
google-chrome-stable --kiosk http://google.com/ --new-window --start-maximized --incognito --autoplay-policy=no-user-gesture-required --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies &
...however that doesn't seem to work anymore (I adjusted the initial command from "google-chrome-stable" to the "chrome.exe" executable on my test machine). The desired page loads up just fine but it doesn't autoplay the audio until I interact with it (e.g. manually refresh the page) to provide that user gesture. Once I provide a user gesture, audio autoplays fine.
I'm even open to building a simple custom C# browser app with CefSharp (I have a couple of those already), but none of the suggested solutions work with that, either. It seems like everything I find is referencing an older version.
Any suggestions for this situation in 2021 which isn't something that could be seen as an exploitable workaround (e.g. Javascript triggering a click) that would probably be fixed in a near future build of browsers?
The command line does not work because the statement that should allow the sound to play
--autoplay-policy=no-user-gesture-required
is cancelled by the
--disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies
which is equivalent to "autoplay is never allowed".
Full details can be found in the 'Developer Switches' from the Chrome documentation (https://developer.chrome.com/blog/autoplay/).
Related
If I visit a site, I want to close the Chrome Web Browser. Is it possible to write such a program?
Under normal operation, this should not be possible. However, there have been cases where browsers have had well known bugs that could be exploited. To be clear though, I'm referring to crashing the browser. There is no supported API or method of asking the browser to close.
For instance, a simple line of CSS could crash Internet Explorer 6. Something like this on Chrome would probably not work anyways, since Chrome runs each tab in its own process.
There is a way to close a browser window (tab) via script if your script opened the window, simply by calling window.close() (where window is the child window). Please see https://developer.mozilla.org/en-US/docs/Web/API/Window/close for more information.
I am making a Chrome Extension and "autoplay" is essential to it.
The extension is a kind of audio player. It lets me add sites to a playlist and the extension will automatically go to each of those URLs and play their content in order.
Since the program needs to go from one element in the playlist to the next seamlessly, I can't require user interaction.
I wanted to enable autoplay in MY OWN browser so that I could at least use the software personally, but I can't even figure out how to do that.
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
On that link it says to go to chrome://flags/#autoplay-policy but this flag doesn't seem to exist.
Chrome Version 78.0.3904.108 (Official Build) (64-bit)
Note
I found a workaround, which is keep the actual audio player page alive and load the other pages in an iframe. This only works because they don't enforce same-origin policy. However I'm still curious if there's a way to disable the whole autoplay restriction.
It's possible to start Chrome with a flag that turns off the autoplay policy. Unfortunately this can only be done via the command line. At least as far as I know.
On macOS it looks like this:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --autoplay-policy=no-user-gesture-required
It's a bit different for other operating systems. But there is an official guide which explains how to start Chromium (or Chrome) from the command line on Windows or Linux.
The setting will not persist. The next time you start Chrome without that flag it will have the autoplay policy enabled again.
In Google Chrome 66, autoplay policy changed.
You can read about it here:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
As a developer, I need to develop workarounds.
Of course, the first step to developing for this scenario is being able to reliably reproduce the scenario where:
A user visits a site that does not have a significant enough MEI index.
Autoplay is disabled unless the video is muted.
Here's my issue.
Os X, Chrome 67.0.3396.99
Steps to Reproduce:
Disable MEI detection and autoplay using ALL of the Developer Switches
This means:
a) Visit chrome://flags/#autoplay-policy and change the behavior to Document user activation is required and restart Chrome.
b) Run Chrome using: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies
Visit a site that should allow autoplay, i.e YouTube.com
Expected Result:
Autoplay doesn't engage.
Actual Result:
It does.
Thanks in advance.
It turns out that
Step (a) appears to be unnecessary.
When running step (b) make sure that you close Chrome entirely first. If you get the message "Created new window in existing browser session", you are in trouble.
To reiterate:
Steps To Reproduce:
1) Quit Chrome entirely.
2) Run Chrome using: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies
3) Visit YouTube.com
Result:
Video starts paused.
I've found, additionally, that my videos will still autoplay unless I click the address bar and click "enter", rather than refreshing the page.
We have a Chrome extension that can be used to open a page into our website. From there the user then continues onto the next page which has a custom NPAPI plug-in embedded in it. This has always worked fine. However, since the version 32 update the plug-in loads and runs (it's a video conferencing plug-in and is clearly running as the other side can see video) however it doesn't show up on the page. Examining the DOM everything looks fine. Grabbing the border and re-sizing the browser will cause the plug-in to suddenly render correctly. I've tried all manner of javascript/css tricks to try and mimic this behavior as a workaround but nothing works. Tabs opened manually (not using chrome.tabs.create) work fine.
This worked up till 32.
Any ideas around this?
Chrome 32 is phasing out NPAPI, read the announcement here.
There is a deprecation guide that you can read here.
It seems like Google wants you to use it's Native Client tech to run native compiled code on user's machines. It is cool stuff...but so far I've found it difficult/more limiting to work with when compared to NPAPI (but there are obvious upsides, security for instance).
You could also build a native app and use native message passing to communicate from extension -> app. Once downside to this is that there is currently no way to bundle a native app into an extension install, so the user will need to download and install your app separately.
Today google chrome updated to last version, before that update the website was working without any problem. It's working on firefox and internet explorer without any problem though.
What's wrong with google chrome ?
http://www.mersin-mezitli-satilik-daire.com/3-boyutlu-sanal-tur-mersin-mezitli-satilik-daire.php?iframe=3&anasayfa=1
This issue may be caused by the dreaded 'Pepper' Flash Player, which has also been breaking Flash content for me in Chrome.
I don't know what the solution is for your broader audience of Chrome visitors, but to fix the problem locally:
In a new tab, go to the URL: chrome://plugins/
Find the entry for 'Flash' and expand [+] Details if not already expanded
Look for the entry where the location of the plugin ends: ...PepperFlash\pepflashplayer.dll and click 'Disable'
You will hopefully have at least one other instance of Flash Player installed (if not, try installing a debug player from Adobe's website), and enable one of these.
I should mention, the Pepper Flash Player seems to regularly re-enable itself, possibly whenever Chome auto-updates itself, and I find myself having to repeat this process every couple of days.