From 6096f4f81f3ab011be52b077f0fd6b0e246b7c67 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 24 Mar 2024 13:42:12 +0100 Subject: Updated 6 files, added 17 files and renamed client/fragments/experiments.html (automated) --- client/assets/icons2/appearance.svg | 1 + client/assets/icons2/blocker.svg | 1 + client/assets/icons2/experiments.svg | 2 +- client/assets/icons2/platform.svg | 1 + client/assets/icons2/search.svg | 1 + client/assets/icons2/security.svg | 1 + client/assets/icons2/settings.svg | 1 + client/assets/icons2/spyglass.svg | 1 + client/assets/icons2/system.svg | 1 + client/dom/index.html | 7 +- client/dom/new.html | 36 ++++--- client/fragments/experiments.html | 95 ------------------ client/fragments/home.html | 24 ++--- client/fragments/settings.html | 151 +++++++++++++++++++++++++++++ client/fragments/settings/about.html | 57 +++++++++++ client/fragments/settings/appearance.html | 20 ++++ client/fragments/settings/blocking.html | 20 ++++ client/fragments/settings/experiments.html | 102 +++++++++++++++++++ client/fragments/settings/platform.html | 20 ++++ client/fragments/settings/search.html | 20 ++++ client/fragments/settings/security.html | 20 ++++ client/fragments/settings/spyglass.html | 20 ++++ client/fragments/settings/system.html | 20 ++++ client/main.js | 23 ++++- client/src/plugin.js | 68 +++++++------ 25 files changed, 551 insertions(+), 162 deletions(-) create mode 100644 client/assets/icons2/appearance.svg create mode 100644 client/assets/icons2/blocker.svg create mode 100644 client/assets/icons2/platform.svg create mode 100644 client/assets/icons2/search.svg create mode 100644 client/assets/icons2/security.svg create mode 100644 client/assets/icons2/settings.svg create mode 100644 client/assets/icons2/spyglass.svg create mode 100644 client/assets/icons2/system.svg delete mode 100644 client/fragments/experiments.html create mode 100644 client/fragments/settings.html create mode 100644 client/fragments/settings/about.html create mode 100644 client/fragments/settings/appearance.html create mode 100644 client/fragments/settings/blocking.html create mode 100644 client/fragments/settings/experiments.html create mode 100644 client/fragments/settings/platform.html create mode 100644 client/fragments/settings/search.html create mode 100644 client/fragments/settings/security.html create mode 100644 client/fragments/settings/spyglass.html create mode 100644 client/fragments/settings/system.html diff --git a/client/assets/icons2/appearance.svg b/client/assets/icons2/appearance.svg new file mode 100644 index 0000000..315fc5c --- /dev/null +++ b/client/assets/icons2/appearance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/blocker.svg b/client/assets/icons2/blocker.svg new file mode 100644 index 0000000..20e9889 --- /dev/null +++ b/client/assets/icons2/blocker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/experiments.svg b/client/assets/icons2/experiments.svg index 5b9bb79..8ef5c55 100644 --- a/client/assets/icons2/experiments.svg +++ b/client/assets/icons2/experiments.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/client/assets/icons2/platform.svg b/client/assets/icons2/platform.svg new file mode 100644 index 0000000..14e3462 --- /dev/null +++ b/client/assets/icons2/platform.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/search.svg b/client/assets/icons2/search.svg new file mode 100644 index 0000000..ef0d052 --- /dev/null +++ b/client/assets/icons2/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/security.svg b/client/assets/icons2/security.svg new file mode 100644 index 0000000..20b9e39 --- /dev/null +++ b/client/assets/icons2/security.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/settings.svg b/client/assets/icons2/settings.svg new file mode 100644 index 0000000..817c782 --- /dev/null +++ b/client/assets/icons2/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/spyglass.svg b/client/assets/icons2/spyglass.svg new file mode 100644 index 0000000..5f40f96 --- /dev/null +++ b/client/assets/icons2/spyglass.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/assets/icons2/system.svg b/client/assets/icons2/system.svg new file mode 100644 index 0000000..b21bc6f --- /dev/null +++ b/client/assets/icons2/system.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/dom/index.html b/client/dom/index.html index a5d6045..e0a9f5a 100644 --- a/client/dom/index.html +++ b/client/dom/index.html @@ -332,6 +332,7 @@ webview.id = "wv-item-" + tab.id + "-inner"; container.id = "wv-item-" + tab.id; container.classList.add("wv-container"); + webview.setAttribute("allowpopups", ""); // # M3 backport # webview.addEventListener('devtools-open-url', (e) => { openTab(e.url); }); @@ -505,12 +506,6 @@ if (!sgc()) return; openTab("https://school.equestria.dev"); - if (localStorage.getItem("cr3-trial-experiments") === "true") { - openTab("../fragments/experiments.html", false, true); - } else { - openTab("../fragments/soon.html", false, true); - } - openHome(); tabs[0].fixed = false; diff --git a/client/dom/new.html b/client/dom/new.html index 7af29da..22a9988 100644 --- a/client/dom/new.html +++ b/client/dom/new.html @@ -162,10 +162,10 @@ secureTabHeight(); } - let lastTabHeightUpdateCount = tabs.length; - function openAbout() { - ipcRenderer.send("about"); + let tab = tabs.find(i => i.fixed && i.url.endsWith("/settings.html")); + switchToTab(window.tabs.indexOf(tab)); + tab.webview.children[1].executeJavaScript("location.hash = '#about';"); } function secureTabHeight(force) {} @@ -201,7 +201,7 @@ } } - function openTab(url, focusSearchBar, pinned, ignoreRefresh) { + function openTab(url, focusSearchBar, pinned, ignoreRefresh, unisolated) { let container = document.createElement("div"); let webview = document.createElement("webview"); @@ -225,18 +225,19 @@ bar.style.borderBottom = "1px solid rgba(0, 0, 0, .1)"; bar.style.paddingLeft = bar.style.paddingRight = "3vw"; bar.style.display = "grid"; + bar.style.webkitAppRegion = "drag"; bar.style.gridTemplateColumns = "1fr max-content 1fr"; bar.classList.add("bar"); bar.innerHTML = `
- Back - Forward - Refresh + Back + Forward + Refresh
-
+
-
Search with DuckDuckGo or enter address
+
Search with DuckDuckGo or enter address
@@ -248,6 +249,10 @@ webview.id = "wv-item-" + tab.id + "-inner"; container.id = "wv-item-" + tab.id; container.classList.add("wv-container"); + webview.setAttribute("allowpopups", ""); + if (unisolated) webview.setAttribute("nodeintegration", ""); + if (unisolated) webview.setAttribute("nodeintegrationinsubframes", ""); + if (unisolated) webview.setAttribute("webpreferences", "contextIsolation=false"); webview.addEventListener('devtools-open-url', (e) => { openTab(e.url); }); @@ -317,6 +322,10 @@ } function switchToTab(id) { + try { + tabs.find(i => i.fixed && i.url.endsWith("/settings.html")).webview.children[1].executeJavaScript("location.hash = '#search';"); + } catch (e) {} + window.activeTab = id; refreshTabBar(); @@ -414,12 +423,7 @@ window.addEventListener('load', () => { openTab("https://school.equestria.dev"); - - if (localStorage.getItem("cr3-trial-experiments") === "true") { - openTab("../fragments/experiments.html", false, true); - } else { - openTab("../fragments/soon.html", false, true); - } + openTab("../fragments/settings.html", false, true, false, true); openHome(); tabs[0].fixed = false; @@ -467,7 +471,7 @@ } else if (new URL(url).protocol === "http:") { return `Not secure — ${new URL(url).host}`; } else if (new URL(url).protocol === "file:") { - return `Local — ${new URL(url).pathname}`; + return `Local — ${decodeURI(new URL(url).pathname)}`; } else if (new URL(url).hostname === "equestria.dev" || new URL(url).hostname.endsWith(".equestria.dev") || new URL(url).hostname === "pone.eu.org" diff --git a/client/fragments/experiments.html b/client/fragments/experiments.html deleted file mode 100644 index 391ffc8..0000000 --- a/client/fragments/experiments.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - Experiments - - - -
-

Experiments

- -

WARNING: EXPERIMENTAL FEATURES AHEAD! By enabling these features, you could lose browser data or compromise your security or privacy. If you are an enterprise admin you should not be using these flags in production.

-

The browser will need to reload to apply the new features. This will destroy all children, meaning you might lose unsaved data. For your safety, close all the open tabs before continuing.

- - - -
-
- - - - diff --git a/client/fragments/home.html b/client/fragments/home.html index d1bab78..af1a98f 100644 --- a/client/fragments/home.html +++ b/client/fragments/home.html @@ -44,7 +44,13 @@

What's new in Chatroom?