@@ -30,42 +30,42 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) {
3030 String prefFileName = path .getAbsolutePath () + File .separator + "user.js" ;
3131 Log .i (LOGTAG , "Creating file: " + prefFileName );
3232 try (FileOutputStream out = new FileOutputStream (prefFileName )) {
33- out .write ("pref (\" dom.vr.enabled\" , true);\n " .getBytes ());
34- out .write ("pref (\" dom.vr.external.enabled\" , true);\n " .getBytes ());
35- out .write ("pref (\" dom.vr.webxr.enabled\" , true);\n " .getBytes ());
36- out .write ("pref (\" webgl.enable-surface-texture\" , true);\n " .getBytes ());
33+ out .write ("user_pref (\" dom.vr.enabled\" , true);\n " .getBytes ());
34+ out .write ("user_pref (\" dom.vr.external.enabled\" , true);\n " .getBytes ());
35+ out .write ("user_pref (\" dom.vr.webxr.enabled\" , true);\n " .getBytes ());
36+ out .write ("user_pref (\" webgl.enable-surface-texture\" , true);\n " .getBytes ());
3737 // Enable MultiView draft extension
38- out .write ("pref (\" webgl.enable-draft-extensions\" , true);\n " .getBytes ());
39- out .write ("pref (\" apz.allow_double_tap_zooming\" , false);\n " .getBytes ());
40- out .write ("pref (\" dom.webcomponents.customelements.enabled\" , true);\n " .getBytes ());
41- out .write ("pref (\" javascript.options.ion\" , true);\n " .getBytes ());
42- out .write ("pref (\" media.webspeech.synth.enabled\" , false);\n " .getBytes ());
38+ out .write ("user_pref (\" webgl.enable-draft-extensions\" , true);\n " .getBytes ());
39+ out .write ("user_pref (\" apz.allow_double_tap_zooming\" , false);\n " .getBytes ());
40+ out .write ("user_pref (\" dom.webcomponents.customelements.enabled\" , true);\n " .getBytes ());
41+ out .write ("user_pref (\" javascript.options.ion\" , true);\n " .getBytes ());
42+ out .write ("user_pref (\" media.webspeech.synth.enabled\" , false);\n " .getBytes ());
4343 // Prevent autozoom when giving a form field focus.
44- out .write ("pref (\" formhelper.autozoom\" , false);\n " .getBytes ());
44+ out .write ("user_pref (\" formhelper.autozoom\" , false);\n " .getBytes ());
4545 // Disable WebRender until it works with FxR
46- out .write ("pref (\" gfx.webrender.force-disabled\" , true);\n " .getBytes ());
47- out .write ("pref (\" signon.rememberSignons\" , false);\n " .getBytes ());
46+ out .write ("user_pref (\" gfx.webrender.force-disabled\" , true);\n " .getBytes ());
47+ out .write ("user_pref (\" signon.rememberSignons\" , false);\n " .getBytes ());
4848 // Disable web extension process until it is able to restart.
49- out .write ("pref (\" extensions.webextensions.remote\" , false);\n " .getBytes ());
49+ out .write ("user_pref (\" extensions.webextensions.remote\" , false);\n " .getBytes ());
5050 if (BuildConfig .DEBUG ) {
5151 int processCount = SettingsStore .getInstance (aContext ).isMultiE10s () ? 3 : 1 ;
52- out .write (("pref (\" dom.ipc.processCount\" , " + processCount + ");\n " ).getBytes ());
52+ out .write (("user_pref (\" dom.ipc.processCount\" , " + processCount + ");\n " ).getBytes ());
5353 }
5454 int msaa = SettingsStore .getInstance (aContext ).getMSAALevel ();
5555 if (msaa > 0 ) {
5656 int msaaLevel = msaa == 2 ? 4 : 2 ;
57- out .write (("pref (\" webgl.msaa-samples\" ," + msaaLevel + ");\n " ).getBytes ());
58- out .write ("pref (\" webgl.msaa-force\" , true);\n " .getBytes ());
57+ out .write (("user_pref (\" webgl.msaa-samples\" ," + msaaLevel + ");\n " ).getBytes ());
58+ out .write ("user_pref (\" webgl.msaa-force\" , true);\n " .getBytes ());
5959 } else {
60- out .write ("pref (\" webgl.msaa-force\" , false);\n " .getBytes ());
60+ out .write ("user_pref (\" webgl.msaa-force\" , false);\n " .getBytes ());
6161 }
6262 addOptionalPref (out , "dom.vr.require-gesture" , aExtras );
6363 addOptionalPref (out , "privacy.reduceTimerPrecision" , aExtras );
6464 if (aExtras != null && aExtras .getBoolean ("media.autoplay.enabled" , false )) {
6565 // Enable playing audios without gesture (used for gfx automated testing)
66- out .write ("pref (\" media.autoplay.enabled.user-gestures-needed\" , false);\n " .getBytes ());
67- out .write ("pref (\" media.autoplay.enabled.ask-permission\" , false);\n " .getBytes ());
68- out .write ("pref (\" media.autoplay.default\" , 0);\n " .getBytes ());
66+ out .write ("user_pref (\" media.autoplay.enabled.user-gestures-needed\" , false);\n " .getBytes ());
67+ out .write ("user_pref (\" media.autoplay.enabled.ask-permission\" , false);\n " .getBytes ());
68+ out .write ("user_pref (\" media.autoplay.default\" , 0);\n " .getBytes ());
6969 }
7070 } catch (FileNotFoundException e ) {
7171 Log .e (LOGTAG , "Unable to create file: '" + prefFileName + "' got exception: " + e .toString ());
@@ -77,7 +77,7 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) {
7777 private static void addOptionalPref (FileOutputStream out , String aKey , Bundle aExtras ) throws IOException {
7878 if (aExtras != null && aExtras .containsKey (aKey )) {
7979 boolean value = aExtras .getBoolean (aKey );
80- out .write (String .format ("pref (\" %s\" , %s);\n " , aKey , value ? "true" : "false" ).getBytes ());
80+ out .write (String .format ("user_pref (\" %s\" , %s);\n " , aKey , value ? "true" : "false" ).getBytes ());
8181 }
8282 }
8383}
0 commit comments