getUserMedia hangs in incognito - javascript

navigator.mediaDevices.getUserMedia({video: true}) hangs in my tab, no errors or anything. Expected: prompt for permissions
Has anyone encountered this issue before? It only happens to me in Chrome incognito mode. Firefox private browser works as expected

It's possible you've already denied permission for the origin server you're using. Incognito has its own lists of allows and denials, separate from the usual Chromium mode you use.
To diagnose this kind of thing look at the console in your browser devtools. It may say "DOMException: permission denied."
Also, you can click on the lock icon just to the left of the URL while the page is displaying. It will show you the current permission situation, and give you a way to change it.

Related

microphone permissions always denied in Firefox for Android in my environment, but not other platforms

I am developing an audio recorder. A week or so ago it stopped working on Firefox for Android, tested on multiple devices. It works fine in the Desktop version of firefox. I've pinpointed the problem down to a permissions issue. When I call:
navigator.mediaDevices.getUserMedia(constraints)
.then(function(stream) {
/* recording stuff happens */
})
.catch(function(err) {
console.log("error: ",err)
})
I get the error:
MediaStreamError
​
constraint: ""
message: "The request is not allowed by the user agent or the platform in the current context."
name: "NotAllowedError"
stack: ""
However if I run the same codeblock in the console of any other website I don't get this error.
This is also clearly related to microphone permissions. When I run this codeblock in the console on other websites I am prompted to give firefox permission to record. But for some reason in my website I never see such a permission box.
I originally thought this was because I changed something in my settings in Firefox for Android, but when I tested this on other phones running FF for Android, it also doesn't work! Something about my environment is clearly affecting this. But I am stumped as to where to start looking. Are there any hypotheses as to what's going on here?
Edit: some more details that may be relevant to this problem, this was developed with node.js and deployed through Heroku. It was working fine on mobile a week ago but this permissions issue popped up without any changes to the codebase...Happy to supply any further details
I solved this by using HTTPS on my phone. Turns out you need to use HTTPS to call getUserMedia() on your phone but you can use HTTP on desktop. Explains the discrepancy and the other sites I was using that prompted for mic permissions also used https
Enter "about:config" in the address bar and change the settings "media.devices.insecure.enabled" and "media.getusermedia.insecure.enabled" to true.
This should be done for testing only. If Firefox is your primary browser, I don't recommend to change these settings for security reasons.

LinkedIn Authentication Window Auto-Closes With Prompt in IE, Edge

I have an application deployed in three environments, that use the LinkedIn JS API to open the LinkedIn authentication window. In two of those environments, when the LinkedIn window opens, it immediately tries to close itself with a prompt, in IE and Edge (works correctly in Chrome and Firefox, and in all browsers (including IE and Edge) in the third environment):
If you answer "Yes" to this prompt, the window closes and the user can't authenticate. If you answer "No", then a LinkedIn 404 page is shown.
I tried changing permissions for the associated API keys, and generating new API keys entirely, but none of those changes caused the error to go away in the two environments that are failing, or caused the error to appear in the environment where there are currently no issues.
Disabling Protected Mode in IE 11 fixes the issue, and re-enabling it causes the issue to return, but there is no such option in Edge. Disabling extensions with iexplore.exe -extoff {url} does not fix the problem.
You can reproduce the issue in IE or Edge on: https://jobs.sap.com/job/Palo-Alto-Senior-Quality-Specialist-Job-CA-94301/338144501/ by clicking Apply Now > Apply with LinkedIn, entering a fake e-mail address, and clicking Start. The self-closing window should appear. You should find that doing the same on https://sap.valhalla.qa.jobs2web.com/job/San-Mateo-Support-Account-Manager-Job-CA-94401/2160465700/ works correctly, where the LinkedIn authentication window appears, ready for user input.
This has been replicated by others, both on and off of the network I'm working on. I don't see any errors or warnings in the developer tools console. There aren't any browser plug-ins, etc. installed that might be blocking something.
Any ideas as to what I can check to try to resolve this issue?

W10 IE 14(Edge) detectizr navigator.plugins error: permission denied

My web app is failing when I test it in BrowserStack, it breaks in the detectizr.js file, where navigator.plugins is being accessed. When I look at the navigator object via dev tools, I can see that for plugins there is a message saying permission denied and want to confirm if this is why my web app breaks in IE Edge and no other web browser. Has anyone encountered this issue? I am wondering if perhaps it's only an IE14 Edge setting that needs to be changed.
I've seen this same issue in IE Edge on BrowserStack when accessing navigator.plugins. I am using socket.io-client.js which uses this check to see if Flash is enabled. I don't see this issue on my actual Windows computers, so I believe you are on the right track that it is something specific to BrowserStack.
sorry - i wanted to comment not answer, but i don't have a good enough reputation to comment yet. guess i'm not allowed to be helpful yet :(

How IE Browse Mode Changed to 8

We have a web portal product and contains multiple iframes, js files and css files. Every time I visit the portal using IE11, the browse mode becomes 8, as shown in F12.
The weird thing is, I checked ALL requests and responses in Network in F12 Developer Tools, and only three response headers contains x-ua-compatible. The values are
IE=Edge
IE=EmulateIE7
IE=EmulateIE7
I have no idea where IE8 comes from?
Also in our DEV portal, the same product, it shows Browse Mode = Edge, even the same three values also present. It seems the browser mode is changed somewhere else outside Network/F12. I guess it is not javascript. But what can change IE's document mode?
Could this be related to Enterprise Mode? I think this is something that network administrators can set up.
If your product is accessible from the internet, I'd try using IE11 on a computer outside of work and see what happens.
https://technet.microsoft.com/en-us/itpro/internet-explorer/ie11-deploy-guide/what-is-enterprise-mode

Mobile App Authentication/Sencha Touch

I'm trying to write an app using Sencha Touch that ultimately targets iOS and Android. It's supposed to log into the corporate web server and then retrieve and parse some JSON data. It should be very simple. However I'm very new to both Sencha and Javascript, so I'm having a hard time doing this sort of client-side authentication. I can't even seem to make it authenticate from a web browser on my dev machine.
I used this link to help create my login page:
http://miamicoder.com/2012/adding-a-login-screen-to-a-sencha-touch-application/
But when I attempt to log in I seem to get the following error message and a null object:
XMLHttpRequest cannot load https://www.server.com/index.html?=_dc1234567890123
Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin.
Does anyone have any advice or good resources on getting this app to log in? Any help would be greatly appreciated!
Steve, the "is not allowed" error is returned because your login request violates the browser's same-origin policy (essentially it states that all XhrHttpRequests must go to the same domain the page was initially loaded from).
Some browsers offer ways of disabling this error temporarily (which might be fine for short-term development purposes), but for the long-term you'll either need to host your application in the same domain as your backend server, or look into using CORS or JSONP for your requests.
Your AJAX request violates the Same-Origin-Policy. That's why you are getting the error message. If you are using chrome for debugging u can disable the cross-domain Javascript security by doing the following :
For Windows:
1) Create a shortcut to Chrome on your desktop. Right-click on the shortcut and choose Properties, then switch to “Shortcut” tab.
2) In the “Target” field, append the following: –args –disable-web-security
For Mac, Open a terminal window and run this from command-line:
open ~/Applications/Google\ Chrome.app/ –args –disable-web-security
For Ubuntu, Open a terminal window and run this form command line:
open /usr/bin/ and execute ./google-chrome --disable-web-security
There is extension for chrome that does the work:
‪Allow-Control-Allow-Origin.
If you want to active it when the browser started, you have to press on the icon.

Categories