Skip to content

Commit

Permalink
Bug 21792: Suppress MediaError.message when privacy.resistFingerprint…
Browse files Browse the repository at this point in the history
…ing = true
  • Loading branch information
arthuredelstein committed May 2, 2017
1 parent 59cba8d commit 4de3452
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dom/html/MediaError.cpp
Expand Up @@ -7,6 +7,7 @@
#include "mozilla/dom/MediaError.h"
#include "nsDOMClassInfoID.h"
#include "mozilla/dom/MediaErrorBinding.h"
#include "nsContentUtils.h"

namespace mozilla {
namespace dom {
Expand All @@ -31,7 +32,12 @@ MediaError::MediaError(HTMLMediaElement* aParent, uint16_t aCode,
void
MediaError::GetMessage(nsAString& aResult) const
{
CopyUTF8toUTF16(mMessage, aResult);
if (nsContentUtils::IsCallerChrome() ||
!nsContentUtils::ShouldResistFingerprinting()) {
CopyUTF8toUTF16(mMessage, aResult);
} else {
aResult.Truncate();
}
}

JSObject*
Expand Down

0 comments on commit 4de3452

Please sign in to comment.