зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1500541 - Disable about:config in GeckoView on Release and Beta r=ehsan
Differential Revision: https://phabricator.services.mozilla.com/D10410
This commit is contained in:
Родитель
eb69f98699
Коммит
1e1cda1530
|
@ -10,6 +10,14 @@
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
#include "nsIProtocolHandler.h"
|
#include "nsIProtocolHandler.h"
|
||||||
|
|
||||||
|
#if defined(MOZ_WIDGET_ANDROID) && defined(RELEASE_OR_BETA)
|
||||||
|
#define ABOUT_CONFIG_BLOCKED_GV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef ABOUT_CONFIG_BLOCKED_GV
|
||||||
|
#include "mozilla/jni/Utils.h" // for mozilla::jni::IsFennec()
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsAboutRedirector, nsIAboutModule)
|
NS_IMPL_ISUPPORTS(nsAboutRedirector, nsIAboutModule)
|
||||||
|
|
||||||
struct RedirEntry
|
struct RedirEntry
|
||||||
|
@ -174,6 +182,14 @@ nsAboutRedirector::NewChannel(nsIURI* aURI,
|
||||||
MOZ_CRASH("Crash via about:crashcontent");
|
MOZ_CRASH("Crash via about:crashcontent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ABOUT_CONFIG_BLOCKED_GV
|
||||||
|
// We don't want to allow access to about:config from
|
||||||
|
// GeckoView on release or beta, but it's fine for Fennec.
|
||||||
|
if (path.EqualsASCII("config") && !mozilla::jni::IsFennec()) {
|
||||||
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < kRedirTotal; i++) {
|
for (int i = 0; i < kRedirTotal; i++) {
|
||||||
if (!strcmp(path.get(), kRedirMap[i].id)) {
|
if (!strcmp(path.get(), kRedirMap[i].id)) {
|
||||||
nsCOMPtr<nsIChannel> tempChannel;
|
nsCOMPtr<nsIChannel> tempChannel;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче