Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Do not always allow permission to enumerate device labels
Browse files Browse the repository at this point in the history
this basically reverts
electron/electron@fce641a.
the issue points out that this is needed for Electron apps to enumerate
device labels. however, this is not supposed to be allowed unless permission is
granted.

potential fix for brave/browser-laptop#14889
  • Loading branch information
diracdeltas committed Aug 1, 2018
1 parent 4ffc7f0 commit 43587cd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
7 changes: 0 additions & 7 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1287,13 +1287,6 @@ void WebContents::FindReply(content::WebContents* web_contents,
Emit("found-in-page", result);
}

bool WebContents::CheckMediaAccessPermission(
content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
content::MediaStreamType type) {
return true;
}

void WebContents::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
Expand Down
4 changes: 0 additions & 4 deletions atom/browser/api/atom_api_web_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) override;
bool CheckMediaAccessPermission(
content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
content::MediaStreamType type) override;
void RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
Expand Down
24 changes: 0 additions & 24 deletions spec/chromium-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,6 @@ describe('chromium feature', function () {
})
})

describe('navigator.mediaDevices', function () {
if (process.env.TRAVIS === 'true') {
return
}
if (isCI && process.platform === 'linux') {
return
}
if (isCI && process.platform === 'win32') {
return
}

it('can return labels of enumerated devices', function (done) {
navigator.mediaDevices.enumerateDevices().then((devices) => {
const labels = devices.map((device) => device.label)
const labelFound = labels.some((label) => !!label)
if (labelFound) {
done()
} else {
done('No device labels found: ' + JSON.stringify(labels))
}
}).catch(done)
})
})

describe('navigator.language', function () {
it('should not be empty', function () {
assert.notEqual(navigator.language, '')
Expand Down

0 comments on commit 43587cd

Please sign in to comment.