Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox will be identified as "Not a supported browser." if mozGetUserMedia is removed #1156

Open
jan-ivar opened this issue Apr 16, 2024 · 3 comments

Comments

@jan-ivar
Copy link
Collaborator

#764 identified problematic detectBrowser code which prevents browsers from removing non-standard APIs:

    if (navigator.mozGetUserMedia) { // Firefox.
      result.browser = 'firefox';
      result.version = extractVersion(navigator.userAgent,
          /Firefox\/(\d+)\./, 1);
    } else if (navigator.webkitGetUserMedia) {
      // Chrome, Chromium, Webview, Opera.
      // Version matches Chrome/WebRTC version.
      result.browser = 'chrome';
      result.version = extractVersion(navigator.userAgent,
          /Chrom(e|ium)\/(\d+)\./, 2);
    } else if (navigator.mediaDevices &&
        navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { // Edge.
      result.browser = 'edge';
      result.version = extractVersion(navigator.userAgent,
          /Edge\/(\d+).(\d+)$/, 2);
    } else if (navigator.mediaDevices &&
        navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { // Safari.
      result.browser = 'safari';
      result.version = extractVersion(navigator.userAgent,
          /AppleWebKit\/(\d+)\./, 1);
    } else { // Default fallthrough: not supported.
      result.browser = 'Not a supported browser.';
      return result;
    }

E.g. Firefox cannot remove mozGetUserMedia without this returning "Not a supported browser."

The #1146 fix to #764 is unsatisfactory, relying on an API that is not standards-track to solve this problem only for Chromium.

The core problem, that this function treats browsers without specific non-standard APIs as "Not a supported browser." remains unaddressed.

@fippo
Copy link
Member

fippo commented Apr 16, 2024

From what I recall you agreed to this in the context of #151 -- it has been a while though.

@jan-ivar
Copy link
Collaborator Author

Thanks for the link. To clarify, I intimated "there are no plans to unprefix it." on navigator. We have plans to remove it.

@fippo
Copy link
Member

fippo commented Apr 17, 2024

If you want to do something more effective than breaking a ton of sites and reducing Firefox WebRTC reach further make that method throw but keep it around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants