Bug 1383984 - Enable debugging HTMLMediaElement APIs with 'tabs' permission - r=jya,smaug

While "debugger" is not available yet, we can enable these debugging APIs for
extensions that have the "tabs" privilege, which includes the Media Panel
Devtools extension, so we/webdev will get better media-playback information.

MozReview-Commit-ID: I0MAZH9g0HU
This commit is contained in:
Gerald Squelart
2017-07-25 15:53:01 +12:00
parent 9ab3fe942e
commit e4e286e64e
3 changed files with 10 additions and 7 deletions

View File

@@ -7547,10 +7547,12 @@ HTMLMediaElement::MarkAsTainted()
}
}
bool HasDebuggerPrivilege(JSContext* aCx, JSObject* aObj)
bool
HasDebuggerOrTabsPrivilege(JSContext* aCx, JSObject* aObj)
{
return nsContentUtils::CallerHasPermission(aCx,
NS_LITERAL_STRING("debugger"));
NS_LITERAL_STRING("debugger")) ||
nsContentUtils::CallerHasPermission(aCx, NS_LITERAL_STRING("tabs"));
}
void