add userChrome CSS enablement for Firefox app mode

Former-commit-id: ccdfeac71a
Former-commit-id: b3e477a84e261e12c65b514b620cb5cec5ca8acf
This commit is contained in:
idk
2022-09-15 21:01:55 -04:00
parent 24df8dda06
commit a133ee1d8f
4 changed files with 19 additions and 8 deletions

View File

@ -227,3 +227,4 @@ user_pref("webgl.enable-webgl2", false);
user_pref("dom.w3c_touch_events.enabled", false);
user_pref("browser.privatebrowsing.autostart", false);
user_pref("browser.display.use_system_colors", false);
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);

View File

@ -227,3 +227,4 @@ user_pref("webgl.enable-webgl2", false);
user_pref("dom.w3c_touch_events.enabled", false);
user_pref("browser.privatebrowsing.autostart", false);
user_pref("browser.display.use_system_colors", false);
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);

View File

@ -232,10 +232,19 @@ public class I2PFirefoxProfileBuilder extends I2PCommonBrowser {
logger.info("Error copying base profile to profile" + e);
return false;
}
// if user-overrides.js does not exist yet, make an empty one.
// if (!touch(profileDir.toString(), "user-overrides.js")) {
// return false;
//}
if (userOverrides.exists()) {
if (app) {
I2PFirefoxProfileChecker.undoValue(
"user_pref(\"toolkit.legacyUserProfileCustomizations.stylesheets\", false);",
"user_pref(\"toolkit.legacyUserProfileCustomizations.stylesheets\", true);",
userOverrides);
} else {
I2PFirefoxProfileChecker.undoValue(
"user_pref(\"toolkit.legacyUserProfileCustomizations.stylesheets\", true);",
"user_pref(\"toolkit.legacyUserProfileCustomizations.stylesheets\", false);",
userOverrides);
}
}
return true;
}

View File

@ -134,8 +134,8 @@ public class I2PFirefoxProfileChecker extends I2PCommonBrowser {
return true;
}
private static boolean undoValue(String oldString, String newString,
File fileToBeModified) {
public static boolean undoValue(String oldString, String newString,
File fileToBeModified) {
String oldContent = "";
BufferedReader reader = null;
FileWriter writer = null;