How can I enable autoplay (not initiated by user) in Firefox? - firefox

I have one page that launches another page, and the launched page does a series of scrapes and then plays an audio based on the results.
This stopped working today, maybe because of a Firefox update, but I need to be able to enable auto play as it is critical that the audio plays when the launched page loads.
Here is what my current JavaScript code looks like:
function playHighRiskStock(){
var highRiskStock = new Audio('./wav/high-risk.wav');
highRiskStock.play();
}
It is now giving me the error: NotAllowedError: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
It did this all-of-a-sudden (i.e. it was working perfectly yesterday autoplaying with no problems).
How do I configure my browser to allow autoplay, even if not initiated by the user?
I have looked at this page: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide but it doesn't give any actual JavaScript code examples on setting auto play.

I got the same error in Firefox. The following fixed it for me. Didn't need a reboot or to reload the browser.
Click the Hamburger (Options Menu).
Pick the Options menu.
In the search textbox, enter "Sound".
A "Block websites from automatically playing sound" option will appear.
Either uncheck that option or click the "Exceptions" button beside it. In my case, I added an exception for https://app.pluralsight.com. It works fine now.
Another option is to use Chrome.
Good luck.

Related

Open a popup (e.g. native browser) from a Teams desktop client app tab

Is there any way to pop open a browser window from a Teams app tab (desktop client)?
I came across the following link and from my interpretation of the reply it seems it's not possible.
Quoted from link for reference:
Unfortunately it’s not possible to use window.open in Teams tabs. Because we block opening of new windows to arbitrary sites within our Teams Desktop Client (for security reasons) you need to always use microsoftTeams.authentication.authenticate (if you want a popup window) or microsoftTeams.tasks.startTask (if you want an iframe-based dialog) to open a secondary app view.
It's not very clear to me what the microsoftTeams.authentication.authenticate reference above is suggesting.
Alternatively, if not a browser window, can we attempt to open another app installed on the device (e.g. Excel)?
Thanks in advance!
Are you just wanting to launch a new browser entirely? If so, a regular anchor tag, with a target attribute (e.g. ...), will work fine (I'm doing this in a tab myself, and it's working without problem).
You could try using a TaskModule to open a custom HTML/ Javascript or an iframe based widget inside a popup from within your Teams tab.
microsoftTeams.authentication.authenticate() will let you Authenticate the user against you tab. You can find the docs for this here.

How to make the Web Bluetooth Pair button work when run as chrome app

I have a simple set of HTML and JS which when I test it directly as a web page, loaded locally from the file system in Chrome, works fine. I can click a button causing a call to navigator.bluetooth.requestDevice. This correctly causes the usual window to appear and it lists the expected Bluetooth peripheral. I can then select it and successfully pair, with my code receiving the expected callback.
If I try to execute the same html/js as a Chrome app, with a manifest and invoked from chrome://extensions the requestDevice window appears and lists the expected peripheral with the Pair button disabled. If I select the peripheral, the Pair button becomes enabled but if I click it, the window disappears into the background, behind Chrome and nothing else happens that I can see. My code receives no callback. It looks like the call was competely ignored.
What do I need to do to make this work within a Chrome app?
Thanks
Chrome Apps and Extensions should be able to use Web Bluetooth. This is a bug. I've filed chromium issue 751819.
As a work around, create the Chrome App window larger than the device chooser dialog that pops up.

Open second window when laravel app opens

I am creating an app with Laravel that is supposed to use GoogleMaps API to show certain data in the map.
What I want to achieve is, that when you browse the root of the app, so when the user hits the main website, a new window is opened that will show a map to work with. So I want to have the ability to work with a second screen that only shows the map and all the information that should be displayed on the map.
How can I open a new window with certain content automatically when I browse to the main page.
Best
Sebastian
All modern browsers prevent this from happening, as it's commonly abused to serve popup advertisements. You'll need to make the new window happen via a user action, like a click on a button.

IE: When clicking Google +1 a new window opens and then tries to close again

I have recently introduced some Google +1 buttons to my site.
I am calling the button like this:
<g:plusone size="small"
count="false"
callback="plusone_vote"
href='http://www.mysite.com'>
</g:plusone>
The plusone_vote callback is a js function which pushes a tracking event to Google Analytics.
This works for the majority of users. However, a small number are getting an issue. When they click on the +1 link a new IE window appears and then displays the message
"The webpage you're viewing is trying to close this window.
Do you want to close this window?"
If the user clicks "No" they get they Google +1 privacy page ("I'm fine with Google using my +1's and other info around content and ads on non-Google websites"). They can then click the "Share my +1's button" and the window closes. However, they "+1" action never appears to happen. The button does not turn blue and the page does not show up in their profile.
The users were all using IE8 or IE9 on Windows 7 - a combination which works fine for most users. The only thing that appears to be the same is that they all use the same type of laptop - I'm struggling to see the significance of that though.
Any ideas?
The actual issue is with your IE security settings: the page MUST be displayed as a regular 'internet' webpage in order for IE to correctly run the +1 and Facebook Like plugins without this error message.
In order to fix this:
Go into Internet Options in the IE menu
Go to Security Settings. Click on 'local intranet'.
Click on sites. Make sure 'detect local intranet' and all it's sub checkboxes are unchecked. Go into 'advanced' and make sure your webpage's domain is not listed. Close this window.
Now, click on 'Trusted Sites' and then 'Sites'. Make sure to remove your site's domain if it's listed.
All sites which are not 'Intranet' or a 'Trusted Site' default to public internet settings, which is the same as what your users will see (unless you're writing a business application which runs for internal network users, I suppose). This should fix this pop up, and allow +1 and Facebook like plugins to function correctly.

In IE6, how can I determine if window.open is redefined?

I have this odd problem with a third party script. On our site a popup window loads a demo of one of our applications when a link is clicked. The third party script is supposed to popup an additional window underneath at the same time or sometime thereafter.
(Yeah this sounds crazy but the popups must load in this way.)
Of course this works fine in FF3.
Problem is in IE6 only the third party script pops up, but not the demo popup. If I click the link again the demo popup works.
After the thirdparty script saves it's session cookie it's window doesnt popup anymore but then the Tools popup works. (if i reload the page and it saves the cookie info -- this is the expected behavior. the third party popup should only load on the first session)
Seems to me that at some point down the wire windows.open isnt getting called properly because of some timing issue or windows.open being redefined somewhere. I don't see any error messages.
To pinpoint the issue I thought I'd have to see whats going on with the windows on the click.
I guess I need some help in figuring out what information I should look for to try and debug this issue.
This'll tell you if you're dealing with the real window.open or a redefined one:
var isOpenNative = /\[native/.test(window.open+'');

Resources