Refactor browser-dependent UI CSS.

This commit is contained in:
hackademix 2024-10-19 09:41:34 +02:00
parent d3d18fdbc1
commit daa69b22c2
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
2 changed files with 5 additions and 7 deletions

@ -1 +1 @@
Subproject commit 095d75584b9c19203bada0b09d6b05e5f1f15edb Subproject commit 6190ad1d4288385aa1062af35fd62807c2f6ab2d

View File

@ -46,11 +46,9 @@ var UI = (() => {
"/nscl/common/Permissions.js", "/nscl/common/Permissions.js",
"/nscl/common/Policy.js", "/nscl/common/Policy.js",
]; ];
this.mobile = UA.mobile; this.mobile = UA.mobile;
let root = document.documentElement;
if (this.mobile) {
root.classList.add("mobile");
}
await include(scripts); await include(scripts);
let inited = new Promise(resolve => { let inited = new Promise(resolve => {
@ -71,6 +69,8 @@ var UI = (() => {
debug = () => {}; // be quiet! debug = () => {}; // be quiet!
} }
if (UI.local.isTorBrowser) { if (UI.local.isTorBrowser) {
Sites.onionSecure = true;
// TODO: replace the following with pure CSS :content in common.css
const label = document.querySelector("span.tor"); const label = document.querySelector("span.tor");
if (label) { if (label) {
const browserName = (await browser.runtime.getBrowserInfo()).name; const browserName = (await browser.runtime.getBrowserInfo()).name;
@ -80,8 +80,6 @@ var UI = (() => {
); );
} }
} }
document.documentElement.classList.add("tor");
Sites.onionSecure = true;
} }
} }
resolve(); resolve();