зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1496114 - PaymentRequest CTOR is controlled by pref, r=marcosc
This commit is contained in:
Родитель
bcd56bfa14
Коммит
da30b53c07
|
@ -60,12 +60,11 @@ NS_IMPL_RELEASE_INHERITED(PaymentRequest, DOMEventTargetHelper)
|
|||
bool
|
||||
PaymentRequest::PrefEnabled(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
#ifdef NIGHTLY_BUILD
|
||||
return XRE_IsContentProcess() &&
|
||||
Preferences::GetBool("dom.payments.request.enabled");
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
if (!XRE_IsContentProcess()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return StaticPrefs::dom_payments_request_enabled();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -208,6 +208,19 @@ VARCACHE_PREF(
|
|||
// Note, this is not currently safe to use for normal browsing yet.
|
||||
PREF("dom.serviceWorkers.parent_intercept", bool, false)
|
||||
|
||||
// Enable PaymentRequest API
|
||||
#ifdef NIGHTLY_BUILD
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
"dom.payments.request.enabled",
|
||||
dom_payments_request_enabled,
|
||||
bool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// Whether a user gesture is required to call PaymentRequest.prototype.show().
|
||||
VARCACHE_PREF(
|
||||
"dom.payments.request.user_interaction_required",
|
||||
|
|
Загрузка…
Ссылка в новой задаче