mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 09:26:34 +00:00
Started fetching data for sidebars!
This commit is contained in:
16
docs/side-panels.md
Normal file
16
docs/side-panels.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Zen Side Panels
|
||||||
|
|
||||||
|
The `zen.sizepanels.data` configuration will be a JSON string that follows the following data:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
data: {
|
||||||
|
"p1": {
|
||||||
|
"url": "https://google.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"index": [
|
||||||
|
"p1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
@@ -107,20 +107,15 @@ pref('zen.theme.accent-color', "#aac7ff");
|
|||||||
pref('zen.theme.panel-separation', /*7*/0);
|
pref('zen.theme.panel-separation', /*7*/0);
|
||||||
pref('zen.theme.toolbar-themed', true);
|
pref('zen.theme.toolbar-themed', true);
|
||||||
|
|
||||||
// From: https://github.com/yokoffing/Betterfox
|
|
||||||
|
|
||||||
/** DISK CACHE ***/
|
|
||||||
pref('browser.cache.jsbc_compression_level', 3);
|
pref('browser.cache.jsbc_compression_level', 3);
|
||||||
|
|
||||||
/** MEDIA CACHE ***/
|
|
||||||
pref('media.memory_cache_max_size', 65536);
|
pref('media.memory_cache_max_size', 65536);
|
||||||
pref('media.cache_readahead_limit', 7200);
|
pref('media.cache_readahead_limit', 7200);
|
||||||
pref('media.cache_resume_threshold', 3600);
|
pref('media.cache_resume_threshold', 3600);
|
||||||
|
|
||||||
/** IMAGE CACHE ***/
|
|
||||||
pref('image.mem.decode_bytes_at_a_time', 32768);
|
pref('image.mem.decode_bytes_at_a_time', 32768);
|
||||||
|
|
||||||
/** NETWORK ***/
|
|
||||||
pref('network.buffer.cache.size', 262144);
|
pref('network.buffer.cache.size', 262144);
|
||||||
pref('network.buffer.cache.count', 128);
|
pref('network.buffer.cache.count', 128);
|
||||||
pref('network.http.max-connections', 1800);
|
pref('network.http.max-connections', 1800);
|
||||||
@@ -131,12 +126,10 @@ pref('network.dnsCacheExpiration', 3600);
|
|||||||
pref('network.dns.max_high_priority_threads', 8);
|
pref('network.dns.max_high_priority_threads', 8);
|
||||||
pref('network.ssl_tokens_cache_capacity', 10240);
|
pref('network.ssl_tokens_cache_capacity', 10240);
|
||||||
|
|
||||||
/** SPECULATIVE LOADING ***/
|
|
||||||
pref('network.dns.disablePrefetch', true);
|
pref('network.dns.disablePrefetch', true);
|
||||||
pref('network.prefetch-next', false);
|
pref('network.prefetch-next', false);
|
||||||
pref('network.predictor.enabled', false);
|
pref('network.predictor.enabled', false);
|
||||||
|
|
||||||
/** EXPERIMENTAL ***/
|
|
||||||
pref('layout.css.grid-template-masonry-value.enabled', true);
|
pref('layout.css.grid-template-masonry-value.enabled', true);
|
||||||
pref('dom.enable_web_task_scheduling', true);
|
pref('dom.enable_web_task_scheduling', true);
|
||||||
pref('layout.css.has-selector.enabled', true);
|
pref('layout.css.has-selector.enabled', true);
|
||||||
@@ -144,3 +137,5 @@ pref('dom.security.sanitizer.enabled', true);
|
|||||||
|
|
||||||
// Pref to enable the new profiles (TODO: Check this out!)
|
// Pref to enable the new profiles (TODO: Check this out!)
|
||||||
//pref("browser.profiles.enabled", true);
|
//pref("browser.profiles.enabled", true);
|
||||||
|
|
||||||
|
pref('zen.sidebar.data', "{\"data\":{\"p1\":{\"url\":\"https://google.com\",},},\"index\":[\"p1\",]}");
|
||||||
|
@@ -1,8 +1,25 @@
|
|||||||
diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs
|
diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs
|
||||||
index 4ad6c5212b22e7dc0ee9495214b6531676490e95..d90dcfed5da60e19eb1fa7fb88cfb07f9cce5663 100644
|
index f4ea0c87a35a19c09f811576201a7adb865ed74c..30f81ad02cd90f478945845b4d8a47da5f3601f0 100644
|
||||||
--- a/browser/components/BrowserGlue.sys.mjs
|
--- a/browser/components/BrowserGlue.sys.mjs
|
||||||
+++ b/browser/components/BrowserGlue.sys.mjs
|
+++ b/browser/components/BrowserGlue.sys.mjs
|
||||||
@@ -4475,6 +4475,7 @@ BrowserGlue.prototype = {
|
@@ -27,6 +27,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
|
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs",
|
||||||
|
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs",
|
||||||
|
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
|
||||||
|
+ ZenSidebarManager: "resource:///modules/ZenSidebarManager.sys.mjs",
|
||||||
|
ContextualIdentityService:
|
||||||
|
"resource://gre/modules/ContextualIdentityService.sys.mjs",
|
||||||
|
Corroborate: "resource://gre/modules/Corroborate.sys.mjs",
|
||||||
|
@@ -1446,6 +1447,8 @@ BrowserGlue.prototype = {
|
||||||
|
|
||||||
|
AboutHomeStartupCache.init();
|
||||||
|
|
||||||
|
+ lazy.ZenSidebarManager.init();
|
||||||
|
+
|
||||||
|
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
|
||||||
|
},
|
||||||
|
|
||||||
|
@@ -4436,6 +4439,7 @@ BrowserGlue.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async _maybeShowDefaultBrowserPrompt() {
|
async _maybeShowDefaultBrowserPrompt() {
|
||||||
@@ -10,7 +27,7 @@ index 4ad6c5212b22e7dc0ee9495214b6531676490e95..d90dcfed5da60e19eb1fa7fb88cfb07f
|
|||||||
// Highest priority is about:welcome window modal experiment
|
// Highest priority is about:welcome window modal experiment
|
||||||
// Second highest priority is the upgrade dialog, which can include a "primary
|
// Second highest priority is the upgrade dialog, which can include a "primary
|
||||||
// browser" request and is limited in various ways, e.g., major upgrades.
|
// browser" request and is limited in various ways, e.g., major upgrades.
|
||||||
@@ -4933,6 +4934,16 @@ BrowserGlue.prototype = {
|
@@ -4894,6 +4898,16 @@ BrowserGlue.prototype = {
|
||||||
"nsIObserver",
|
"nsIObserver",
|
||||||
"nsISupportsWeakReference",
|
"nsISupportsWeakReference",
|
||||||
]),
|
]),
|
||||||
|
19
src/browser/components/ZenSidebarManager.sys.mjs
Normal file
19
src/browser/components/ZenSidebarManager.sys.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
|
export var ZenSidebarManager = {
|
||||||
|
init() {
|
||||||
|
this.update();
|
||||||
|
},
|
||||||
|
|
||||||
|
update() {
|
||||||
|
let services = Services.prefs.getStringPref("zen.sidebar.data");
|
||||||
|
if (services === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let data = JSON.parse(services);
|
||||||
|
if (!data.data || !data.index) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(data.data)
|
||||||
|
},
|
||||||
|
};
|
@@ -1,8 +1,8 @@
|
|||||||
diff --git a/browser/components/moz.build b/browser/components/moz.build
|
diff --git a/browser/components/moz.build b/browser/components/moz.build
|
||||||
index 6fd86955650e4589677007eb8aeee39c1839fedd..600ff91802e7357be3c55dac626ce2ca79544cd2 100644
|
index 0f91b90fb0ce4eac232d71ad4f9ff82ab7316635..f1596aa7d0ab7e058d3482c0dac8ab10157f8bc8 100644
|
||||||
--- a/browser/components/moz.build
|
--- a/browser/components/moz.build
|
||||||
+++ b/browser/components/moz.build
|
+++ b/browser/components/moz.build
|
||||||
@@ -69,6 +69,9 @@ DIRS += [
|
@@ -72,6 +72,9 @@ DIRS += [
|
||||||
"urlbar",
|
"urlbar",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -12,3 +12,11 @@ index 6fd86955650e4589677007eb8aeee39c1839fedd..600ff91802e7357be3c55dac626ce2ca
|
|||||||
DIRS += ["build"]
|
DIRS += ["build"]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -118,3 +121,7 @@ if CONFIG["MOZ_UPDATER"]:
|
||||||
|
MARIONETTE_MANIFESTS += ["tests/marionette/manifest.toml"]
|
||||||
|
|
||||||
|
XPCSHELL_TESTS_MANIFESTS += ["tests/unit/xpcshell.toml"]
|
||||||
|
+
|
||||||
|
+EXTRA_JS_MODULES += [
|
||||||
|
+ "ZenSidebarManager.sys.mjs",
|
||||||
|
+]
|
||||||
|
@@ -109,6 +109,12 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#PanelUI-zen-profiles toolbarbutton {
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#PanelUI-zen-profiles toolbarbutton:last-child {
|
#PanelUI-zen-profiles toolbarbutton:last-child {
|
||||||
margin-bottom: 5px !important;
|
margin-bottom: 5px !important;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user