Skip to content

Commit

Permalink
Run prettier and remove trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vraravam committed Nov 27, 2024
1 parent 2b048b5 commit 418d346
Show file tree
Hide file tree
Showing 55 changed files with 1,175 additions and 1,100 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_issues_enabled: false
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/zen-browser/desktop/discussions
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
runs-on: ubuntu-latest
needs: [debug-inputs]
steps:

- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down Expand Up @@ -206,7 +205,7 @@ jobs:
contents: write
runs-on: ubuntu-latest
needs: [build-data, check-release]

steps:
- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -341,7 +340,7 @@ jobs:
run: |
npm install -g pnpm
sudo apt-get update
sudo apt-get -y install libfuse2 desktop-file-utils appstream
sudo apt-get -y install libfuse2 desktop-file-utils appstream
- name: Download linux build
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -431,7 +430,7 @@ jobs:
mkdir -p updates
cp -a ../linux_update_manifest_generic/. updates/
cp -a ../linux_update_manifest_specific/. updates/
cp -a ../linux_update_manifest_aarch64/. updates/
cp -a ../linux_update_manifest_aarch64/. updates/
if [[ $RELEASE_BRANCH == 'alpha' ]]; then
cp -a ../.github/workflows/object/windows-x64-signed-generic/update_manifest/. updates/
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/linux-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

jobs:
build-linux:

permissions:
contents: write
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
mac-build:
name: Build macOS - ${{ matrix.arch }}

runs-on: macos-14
strategy:
fail-fast: false
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Install dependencies
run: |
pnpm install
- name: Load surfer CI setup
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }}

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

name: Pull request test

on:
pull_request:
branches:
- dev

jobs:
pr-test:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/update-submodules.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Update Components Submodules

on:
Expand All @@ -25,6 +24,6 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[skip ci] 📦 Update Submodules!"
commit_message: '[skip ci] 📦 Update Submodules!'
commit_user_name: Zen Browser Robot
commit_user_email: [email protected]
4 changes: 2 additions & 2 deletions .github/workflows/windows-profile-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ jobs:
C:\MozillaBuildSetup-Latest.exe /S | out-null
- name: Download firefox
run: |
git config --global core.safecrlf false
git config --global core.safecrlf false
pnpm surfer download
- name: Import patches
env:
SURFER_NO_BRANDING_PATCH: true
run: pnpm surfer import
run: pnpm surfer import

- name: Generate
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
arch: [x86_64, x86_64-v3, aarch64]

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type d -not -name 'dist' -exec rm -rf {} \;
find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type f -not -name 'dist' -exec rm -f {} \;
fi
- name: Upload dist object
if: ${{ !inputs.generate-gpo }}
uses: actions/upload-artifact@v4
Expand Down
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![Downloads](https://img.shields.io/github/downloads/zen-browser/desktop/total.svg)](https://github.com/zen-browser/desktop/releases)
[![Crowdin](https://badges.crowdin.net/zen-browser/localized.svg)](https://crowdin.com/project/zen-browser)


✨ Experience tranquillity while browsing the web without people tracking you! Zen is a privacy-focused browser that blocks trackers, ads, and other unwanted content while offering the best browsing experience!

<div flex="true">
Expand Down Expand Up @@ -87,15 +86,15 @@ yay -S zen-browser-avx2-bin
##### Other Linux distributions (AppImage with automated system integration)

- `native` tarball install:
```sudo bash <(curl -s https://updates.zen-browser.app/install.sh)```
`sudo bash <(curl -s https://updates.zen-browser.app/install.sh)`

- `zsync` is required for the Update feature of the script below

```sh
bash <(curl https://updates.zen-browser.app/appimage.sh)
```

* Again, if you don't see your OS listed above, that's because we already have it in our [downloads page](https://zen-browser.app/download)! 🔄
- Again, if you don't see your OS listed above, that's because we already have it in our [downloads page](https://zen-browser.app/download)! 🔄

To upgrade the browser to a newer version, use the embedded update functionality in `About Zen`.

Expand Down
7 changes: 3 additions & 4 deletions docs/contribute.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Branch Structure

The repository is structured as follows:
Expand All @@ -7,14 +6,14 @@ The repository is structured as follows:
dev (main branch)
| |
| \--->-- stable (release branch)
| ^
| ^
^ |
| \-<- Hotfix (hotfixes directly from stable)
|
\-<- (features branches)
```

The `central` branch is the main branch of the repository, and it is the default branch for the repository. The `twilight` branch is the feature branch, and it is branched off from the `central` branch. The `stable` branch is the release branch, and it is branched off from the `central` branch.
The `central` branch is the main branch of the repository, and it is the default branch for the repository. The `twilight` branch is the feature branch, and it is branched off from the `central` branch. The `stable` branch is the release branch, and it is branched off from the `central` branch.

The `stable` branch may have hotfixes directly from the `stable` branch, and the `twilight` branch may have feature branches branched off from the `twilight` branch. This is done so that we can apply hotfixes like security patches directly to the `stable` branch without having to merge the changes from the `twilight` branch.

Expand All @@ -34,4 +33,4 @@ To merge zen stable branch from the twilight branch, you can use the following c

```bash
sh ./scripts/merge-to-branch.sh stable
```
```
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/browser/base/content/ZenCustomizableUI.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export var ZenCustomizableUI = new (class {
_addSidebarButtons(window) {
const sidebarBox = window.MozXULElement.parseXULToFragment(`
<toolbar id="zen-sidebar-top-buttons"
fullscreentoolbar="true"
fullscreentoolbar="true"
class="browser-toolbar customization-target zen-dont-hide-on-fullscreen"
brighttext="true"
data-l10n-id="tabs-toolbar"
Expand Down Expand Up @@ -70,7 +70,7 @@ export var ZenCustomizableUI = new (class {
_moveWindowButtons(window) {
const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container');
const toolboxIcons = window.document.getElementById('zen-sidebar-top-buttons-customization-target');
if (window.AppConstants.platform === 'macosx'|| window.matchMedia('(-moz-gtk-csd-reversed-placement)').matches) {
if (window.AppConstants.platform === 'macosx' || window.matchMedia('(-moz-gtk-csd-reversed-placement)').matches) {
for (let i = 0; i < windowControls.length; i++) {
if (i === 0) {
toolboxIcons.prepend(windowControls[i]);
Expand Down
44 changes: 20 additions & 24 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ var gZenUIManager = {
document.addEventListener('popupshowing', this.onPopupShowing.bind(this));
document.addEventListener('popuphidden', this.onPopupHidden.bind(this));
XPCOMUtils.defineLazyPreferenceGetter(this, 'sidebarHeightThrottle', 'zen.view.sidebar-height-throttle', 500);
XPCOMUtils.defineLazyPreferenceGetter(
this,
'contentElementSeparation',
'zen.theme.content-element-separation',
0
);

XPCOMUtils.defineLazyPreferenceGetter(this, 'contentElementSeparation', 'zen.theme.content-element-separation', 0);

function throttle(f, delay) {
let timer = 0;
return function (...args) {
Expand All @@ -26,7 +21,6 @@ var gZenUIManager = {
);
},


updateTabsToolbar() {
// Set tabs max-height to the "toolbar-items" height
const toolbarItems = document.getElementById('tabbrowser-tabs');
Expand All @@ -35,7 +29,7 @@ var gZenUIManager = {
const toolbarRect = toolbarItems.getBoundingClientRect();
let height = toolbarRect.height;
// -5 for the controls padding
let totalHeight = toolbarRect.height - (this.contentElementSeparation * 2) - 5;
let totalHeight = toolbarRect.height - this.contentElementSeparation * 2 - 5;
// remove the height from other elements that aren't hidden
const otherElements = document.querySelectorAll('#tabbrowser-tabs > *:not([hidden="true"])');
for (let tab of otherElements) {
Expand Down Expand Up @@ -88,7 +82,10 @@ var gZenUIManager = {
for (const el of this._popupTrackingElements) {
// target may be inside a shadow root, not directly under the element
// we also ignore menus inside panels
if (!el.contains(showEvent.explicitOriginalTarget) || (showEvent.explicitOriginalTarget instanceof Element && showEvent.explicitOriginalTarget?.closest('panel'))) {
if (
!el.contains(showEvent.explicitOriginalTarget) ||
(showEvent.explicitOriginalTarget instanceof Element && showEvent.explicitOriginalTarget?.closest('panel'))
) {
continue;
}
document.removeEventListener('mousemove', this.__removeHasPopupAttribute);
Expand Down Expand Up @@ -138,7 +135,7 @@ var gZenVerticalTabsManager = {
XPCOMUtils.defineLazyPreferenceGetter(this, 'canOpenTabOnMiddleClick', 'zen.tabs.newtab-on-middle-click', true);

if (!this.isWindowsStyledButtons) {
document.documentElement.setAttribute("zen-window-buttons-reversed", true);
document.documentElement.setAttribute('zen-window-buttons-reversed', true);
}

if (tabs) {
Expand Down Expand Up @@ -226,19 +223,16 @@ var gZenVerticalTabsManager = {
}

// Check if the sidebar is in hover mode
if (
!this.navigatorToolbox.hasAttribute('zen-right-side') &&
!isCompactMode
) {
if (!this.navigatorToolbox.hasAttribute('zen-right-side') && !isCompactMode) {
this.navigatorToolbox.prepend(topButtons);
// browser.prepend(this.navigatorToolbox);
// browser.prepend(this.navigatorToolbox);
} else {
// customizationTarget.prepend(topButtons);
// tabboxWrapper.prepend(this.navigatorToolbox);
// customizationTarget.prepend(topButtons);
// tabboxWrapper.prepend(this.navigatorToolbox);
}

if (!isVerticalTabs) {
document.getElementById("urlbar-container").after(document.getElementById('navigator-toolbox'));
document.getElementById('urlbar-container').after(document.getElementById('navigator-toolbox'));
}

let windowButtons = this.actualWindowButtons;
Expand Down Expand Up @@ -269,20 +263,22 @@ var gZenVerticalTabsManager = {
titlebar.before(topButtons);
titlebar.before(navBar);
}
document.documentElement.setAttribute("zen-single-toolbar", true);
document.documentElement.setAttribute('zen-single-toolbar', true);
this._hasSetSingleToolbar = true;
} else if (this._hasSetSingleToolbar) {
this._hasSetSingleToolbar = false;
// Do the opposite
this._navbarParent.prepend(navBar);
const elements = document.querySelectorAll('#zen-sidebar-top-buttons-customization-target > *:is(toolbarbutton, #stop-reload-button)');
const elements = document.querySelectorAll(
'#zen-sidebar-top-buttons-customization-target > *:is(toolbarbutton, #stop-reload-button)'
);
for (const button of elements) {
if (button.hasAttribute('zen-single-toolbar')) {
button.removeAttribute('zen-single-toolbar');
document.getElementById('nav-bar-customization-target').append(button);
}
}
document.documentElement.removeAttribute("zen-single-toolbar");
document.documentElement.removeAttribute('zen-single-toolbar');
navBar.appendChild(document.getElementById('PanelUI-button'));
this._toolbarOriginalParent.prepend(navBar);
CustomizableUI.zenInternalCU._rebuildRegisteredAreas();
Expand All @@ -295,7 +291,7 @@ var gZenVerticalTabsManager = {
}

if (doNotChangeWindowButtons) {
document.getElementById("zen-sidebar-top-buttons-customization-target").appendChild(windowButtons);
document.getElementById('zen-sidebar-top-buttons-customization-target').appendChild(windowButtons);
} else if (!isSingleToolbar && !isCompactMode) {
if (this.isWindowsStyledButtons) {
if (isRightSide) {
Expand Down Expand Up @@ -342,4 +338,4 @@ var gZenVerticalTabsManager = {
const newVal = !Services.prefs.getBoolPref('zen.tabs.vertical.right-side');
Services.prefs.setBoolPref('zen.tabs.vertical.right-side', newVal);
},
};
};
Loading

0 comments on commit 418d346

Please sign in to comment.