mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-17 23:32:02 +00:00
Add preference for using Google favicons and refactor related logic
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
|
||||
openWatermark() {
|
||||
if (!Services.prefs.getBoolPref('zen.watermark.enabled', false)) {
|
||||
document.documentElement.removeAttribute('zen-before-loaded');
|
||||
return;
|
||||
}
|
||||
for (let elem of document.querySelectorAll('#browser > *, #urlbar')) {
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -19,12 +19,6 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media not (-moz-bool-pref: 'zen.watermark.enabled') {
|
||||
#zen-watermark {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#customization-footer #customization-toolbar-visibility-button {
|
||||
display: none !important;
|
||||
}
|
||||
|
@@ -556,16 +556,18 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
|
||||
_getWebPanelIcon(url, element) {
|
||||
let { preferredURI } = Services.uriFixup.getFixupURIInfo(url);
|
||||
element.setAttribute('image', `page-icon:${preferredURI.spec}`);
|
||||
fetch(`https://s2.googleusercontent.com/s2/favicons?domain_url=${preferredURI.spec}`).then(async (response) => {
|
||||
if (response.ok) {
|
||||
let blob = await response.blob();
|
||||
let reader = new FileReader();
|
||||
reader.onload = function () {
|
||||
element.setAttribute('image', reader.result);
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
});
|
||||
if (Services.prefs.getBoolPref('zen.sidebar.use-google-favicons')) {
|
||||
fetch(`https://s2.googleusercontent.com/s2/favicons?domain_url=${preferredURI.spec}`).then(async (response) => {
|
||||
if (response.ok) {
|
||||
let blob = await response.blob();
|
||||
let reader = new FileReader();
|
||||
reader.onload = function () {
|
||||
element.setAttribute('image', reader.result);
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_getBrowserById(id) {
|
||||
|
@@ -149,6 +149,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
_initializeEmptyTab() {
|
||||
if (Services.prefs.getBoolPref('zen.workspaces.disable_empty_state_for_testing', false)) {
|
||||
return;
|
||||
}
|
||||
this._emptyTab = gBrowser.addTrustedTab('about:blank', { inBackground: true, userContextId: 0, _forZenEmptyTab: true });
|
||||
}
|
||||
|
||||
@@ -615,6 +618,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
async _selectStartPage() {
|
||||
if (Services.prefs.getBoolPref('zen.workspaces.disable_empty_state_for_testing', false)) {
|
||||
return;
|
||||
}
|
||||
const currentTab = gBrowser.selectedTab;
|
||||
let showed = false;
|
||||
await this.promiseEmptyTabInitialized;
|
||||
|
@@ -1,3 +0,0 @@
|
||||
*
|
||||
|
||||
!.gitignore
|
Reference in New Issue
Block a user