From 154410c81ab3b83b627367f4a83c1902cef9554a Mon Sep 17 00:00:00 2001 From: "Randall E. Barker" Date: Mon, 4 May 2020 03:17:29 -0700 Subject: [PATCH] Update generated user.js to use user_pref (#3311) Fixes #3310 Starting with GeckoView Nightly 77.0.20200430082621 user.js needs to use user_pref() instead of pref() to set prefs. --- .../browser/engine/SessionUtils.java | 42 +++++++++---------- versions.gradle | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java index 7e341efa8..b70c2b75c 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java @@ -30,42 +30,42 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) { String prefFileName = path.getAbsolutePath() + File.separator + "user.js"; Log.i(LOGTAG, "Creating file: " + prefFileName); try (FileOutputStream out = new FileOutputStream(prefFileName)) { - out.write("pref(\"dom.vr.enabled\", true);\n".getBytes()); - out.write("pref(\"dom.vr.external.enabled\", true);\n".getBytes()); - out.write("pref(\"dom.vr.webxr.enabled\", true);\n".getBytes()); - out.write("pref(\"webgl.enable-surface-texture\", true);\n".getBytes()); + out.write("user_pref(\"dom.vr.enabled\", true);\n".getBytes()); + out.write("user_pref(\"dom.vr.external.enabled\", true);\n".getBytes()); + out.write("user_pref(\"dom.vr.webxr.enabled\", true);\n".getBytes()); + out.write("user_pref(\"webgl.enable-surface-texture\", true);\n".getBytes()); // Enable MultiView draft extension - out.write("pref(\"webgl.enable-draft-extensions\", true);\n".getBytes()); - out.write("pref(\"apz.allow_double_tap_zooming\", false);\n".getBytes()); - out.write("pref(\"dom.webcomponents.customelements.enabled\", true);\n".getBytes()); - out.write("pref(\"javascript.options.ion\", true);\n".getBytes()); - out.write("pref(\"media.webspeech.synth.enabled\", false);\n".getBytes()); + out.write("user_pref(\"webgl.enable-draft-extensions\", true);\n".getBytes()); + out.write("user_pref(\"apz.allow_double_tap_zooming\", false);\n".getBytes()); + out.write("user_pref(\"dom.webcomponents.customelements.enabled\", true);\n".getBytes()); + out.write("user_pref(\"javascript.options.ion\", true);\n".getBytes()); + out.write("user_pref(\"media.webspeech.synth.enabled\", false);\n".getBytes()); // Prevent autozoom when giving a form field focus. - out.write("pref(\"formhelper.autozoom\", false);\n".getBytes()); + out.write("user_pref(\"formhelper.autozoom\", false);\n".getBytes()); // Disable WebRender until it works with FxR - out.write("pref(\"gfx.webrender.force-disabled\", true);\n".getBytes()); - out.write("pref(\"signon.rememberSignons\", false);\n".getBytes()); + out.write("user_pref(\"gfx.webrender.force-disabled\", true);\n".getBytes()); + out.write("user_pref(\"signon.rememberSignons\", false);\n".getBytes()); // Disable web extension process until it is able to restart. - out.write("pref(\"extensions.webextensions.remote\", false);\n".getBytes()); + out.write("user_pref(\"extensions.webextensions.remote\", false);\n".getBytes()); if (BuildConfig.DEBUG) { int processCount = SettingsStore.getInstance(aContext).isMultiE10s() ? 3 : 1; - out.write(("pref(\"dom.ipc.processCount\", " + processCount + ");\n").getBytes()); + out.write(("user_pref(\"dom.ipc.processCount\", " + processCount + ");\n").getBytes()); } int msaa = SettingsStore.getInstance(aContext).getMSAALevel(); if (msaa > 0) { int msaaLevel = msaa == 2 ? 4 : 2; - out.write(("pref(\"webgl.msaa-samples\"," + msaaLevel + ");\n").getBytes()); - out.write("pref(\"webgl.msaa-force\", true);\n".getBytes()); + out.write(("user_pref(\"webgl.msaa-samples\"," + msaaLevel + ");\n").getBytes()); + out.write("user_pref(\"webgl.msaa-force\", true);\n".getBytes()); } else { - out.write("pref(\"webgl.msaa-force\", false);\n".getBytes()); + out.write("user_pref(\"webgl.msaa-force\", false);\n".getBytes()); } addOptionalPref(out, "dom.vr.require-gesture", aExtras); addOptionalPref(out, "privacy.reduceTimerPrecision", aExtras); if (aExtras != null && aExtras.getBoolean("media.autoplay.enabled", false)) { // Enable playing audios without gesture (used for gfx automated testing) - out.write("pref(\"media.autoplay.enabled.user-gestures-needed\", false);\n".getBytes()); - out.write("pref(\"media.autoplay.enabled.ask-permission\", false);\n".getBytes()); - out.write("pref(\"media.autoplay.default\", 0);\n".getBytes()); + out.write("user_pref(\"media.autoplay.enabled.user-gestures-needed\", false);\n".getBytes()); + out.write("user_pref(\"media.autoplay.enabled.ask-permission\", false);\n".getBytes()); + out.write("user_pref(\"media.autoplay.default\", 0);\n".getBytes()); } } catch (FileNotFoundException e) { Log.e(LOGTAG, "Unable to create file: '" + prefFileName + "' got exception: " + e.toString()); @@ -77,7 +77,7 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) { private static void addOptionalPref(FileOutputStream out, String aKey, Bundle aExtras) throws IOException { if (aExtras != null && aExtras.containsKey(aKey)) { boolean value = aExtras.getBoolean(aKey); - out.write(String.format("pref(\"%s\", %s);\n", aKey, value ? "true" : "false").getBytes()); + out.write(String.format("user_pref(\"%s\", %s);\n", aKey, value ? "true" : "false").getBytes()); } } } diff --git a/versions.gradle b/versions.gradle index 59d941a84..a2d5036d8 100644 --- a/versions.gradle +++ b/versions.gradle @@ -24,7 +24,7 @@ ext.deps = [:] def versions = [:] // GeckoView versions can be found here: // https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/ -versions.gecko_view = "77.0.20200428100141" +versions.gecko_view = "77.0.20200501094247" versions.android_components = "28.0.1" // Note that android-components also depends on application-services, // and in fact is our main source of appservices-related functionality.