Hello Mozilla,
I am using linux and I have a setup that automatically extracts the 16 main colors of my Desktop Background and applies it to my Terminal, Texteditor, Steam, Taskbars and to the whole Lightsetup in Room aswell as the Pc case. Yes, it is unbelivably awesome
Now I think you already know what I wanât to ask: How can I convince FF to change colors based on external influence. I have researched in to prefs.js, specifically the setting lightweightThemes.usedThemes
All personas data is stored in the pref lightweightThemes.usedThemes in prefs.js in the profile folder and you can backup that pref to a file or copy that pref to user.js
if you want to initialize a new profile.
Donât leave it in user.js or you wonât be able to add new personas because it is read on every start of Firefox and you lose personas added in the previous browser session.
I am inclined to crop the exact part of my background and apply it as âpersonaâ to FF without restarting it.
Personas Plus is able to set it by javascript, of witch i know very litteâŚ
If it is installed you can reach the âApply a Custom Themeâ with this URL:
moz-extension://49a96e4c-e7a0-46e4-aa37-b350872c94fd/custom/custom.html
Calling the following âcustom.jsâ:
document.querySelector("#form-submit").addEventListener(âclickâ, () => {
let backgroundColor = document.querySelector("#accent-color").value;
let textColor = document.querySelector("#text-color").value;
let header = document.querySelector("#header-image");
let file = header.files[0];
let reader = new FileReader();
reader.addEventListener("load", () => {
let data = {
images: {
headerURL: reader.result,
},
colors: {
accentcolor: backgroundColor,
textcolor: textColor
}
};
browser.theme.update(data);
browser.storage.local.set({"currentPersona": data});
});
if (file) {
reader.readAsDataURL(file);
}
Is there a way to force FF to run a local .js file that then sets a Persona? If so could you point me in the direction ?
Thankyou,
Moz