Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for main #2019

Closed
wants to merge 20 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ yarn.lock
/dist-js
mas.provisionprofile
.vscode
.DS_store
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/hydrogen
Binary file added build/icon.ico
Binary file not shown.
Binary file added build/icons/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions css/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ body {
}

/* Bind the toolbar as the window's draggable region */
._36ic._5l-3,
._5742,
._6-xk,
._673w {
.x9f619.x1n2onr6.x1ja2u2z.x78zum5.x2lah0s.x1qughib.x6s0dn4.xozqiw3.x1q0g3np.x1sy10c2.xktsk01.xod5an3.x1d52u69.xzd29fr {
-webkit-app-region: drag;
}
[role='navigation'] .x16n37ib {
-webkit-app-region: no-drag;
}
.x9f619.x1n2onr6.x1ja2u2z.x78zum5.xdt5ytf.x193iq5w.xeuugli.x1r8uery.x1iyjqo2.xs83m0k.xsyo7zv.x16hj40l.x10b6aqq.x1yrsyyn {
-webkit-app-region: drag;
}
[role='navigation'] .x1heor9g.x1qlqyl8.x1pd3egz.x1a2a7pz {
margin-left: 60px;
}
Comment on lines +31 to +42
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this is for macOS, it's already fixed #2014


/* Hide footer at login view */
._210n {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "caprine",
"productName": "Caprine",
"version": "2.57.3",
"version": "2.57.4",
"description": "Elegant Facebook Messenger desktop app",
"license": "MIT",
"repository": "sindresorhus/caprine",
Expand Down Expand Up @@ -102,14 +102,22 @@
"!media${/*}"
],
"asarUnpack": [
"static/Icon.png"
"static/Icon.png",
"static/icon.ico"
],
"appId": "com.sindresorhus.caprine",
"mac": {
"category": "public.app-category.social-networking",
"icon": "build/icon.png",
"electronUpdaterCompatibility": ">=2.15.0",
"electronUpdaterCompatibility": ">=4.5.2",
"darkModeSupport": true,
"target": {
"target": "default",
"arch": [
"x64",
"arm64"
]
},
Comment on lines +114 to +120
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already added #2015

"extendInfo": {
"LSUIElement": 1,
"NSCameraUsageDescription": "Caprine needs access to your camera.",
Expand Down
4 changes: 3 additions & 1 deletion packages/rpm/caprine.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%define debug_package %{nil}

Name: caprine
Version: 2.57.3
Version: 2.57.4
Release: 1%{?dist}
Summary: Elegant Facebook Messenger desktop app

Expand Down Expand Up @@ -56,6 +56,8 @@ install -Dm644 license %{buildroot}%{_datadir}/licenses/%{name}
%{_datadir}/pixmaps/%{name}.png

%changelog
* Sat May 6 2023 dusansimic <dusan.simic1810@gmail.com> - 2.57.4-1
- Release 2.57.4
* Sun Apr 30 2023 dusansimic <dusan.simic1810@gmail.com> - 2.57.3-1
- Release 2.57.3
* Sat Apr 29 2023 dusansimic <dusan.simic1810@gmail.com> - 2.57.2-1
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

## Install

*macOS 10.10+, Linux, and Windows 10+ are supported (64-bit only).*
*macOS 10.12+ (Intel and Apple Silicon), Linux (x64 and arm64), and Windows 10+ (64-bit) are supported.*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already added #2015


Download the latest version on the [website](https://sindresorhus.com/caprine) or below.

Expand Down
1 change: 1 addition & 0 deletions source/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ import * as path from 'node:path';
import {fixPathForAsarUnpack} from 'electron-util';

export const caprineIconPath = fixPathForAsarUnpack(path.join(__dirname, '..', 'static', 'Icon.png'));
export const caprineWinIconPath = fixPathForAsarUnpack(path.join(__dirname, '..', 'static', 'icon.ico'));
16 changes: 14 additions & 2 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {sendAction, sendBackgroundAction, messengerDomain, stripTrackingFromUrl}
import {process as processEmojiUrl} from './emoji';
import ensureOnline from './ensure-online';
import {setUpMenuBarMode} from './menu-bar-mode';
import {caprineIconPath} from './constants';
import {caprineIconPath, caprineWinIconPath} from './constants';

ipcMain.setMaxListeners(100);

Expand Down Expand Up @@ -59,6 +59,14 @@ if (!config.get('hardwareAcceleration')) {
app.disableHardwareAcceleration();
}

if (config.get('hardwareAcceleration')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're reading config of the app, the property should be defined in source/config.ts and also you should define migrations so the property gets created after an update.

// Enable hardware acceleration for all configs
app.commandLine.appendSwitch('ignore-gpu-blocklist');
}

// Enables QUIC protocol, used by many Facebook and Google subdomains
app.commandLine.appendSwitch('enable-quic');

if (!is.development && config.get('autoUpdate')) {
(async () => {
const FOUR_HOURS = 1000 * 60 * 60 * 4;
Expand Down Expand Up @@ -288,11 +296,15 @@ function createMainWindow(): BrowserWindow {
y: lastWindowState.y,
width: lastWindowState.width,
height: lastWindowState.height,
icon: is.linux ? caprineIconPath : undefined,
icon: is.linux || is.macos ? caprineIconPath : caprineWinIconPath,
minWidth: 400,
minHeight: 200,
alwaysOnTop: config.get('alwaysOnTop'),
titleBarStyle: 'hiddenInset',
trafficLightPosition: {
x: 80,
y: 20,
},
Comment on lines +304 to +307
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fixed #2014

autoHideMenuBar: config.get('autoHideMenuBar'),
webPreferences: {
preload: path.join(__dirname, 'browser.js'),
Expand Down
14 changes: 12 additions & 2 deletions source/menu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'node:path';
import {existsSync, writeFileSync} from 'node:fs';
import {app, shell, Menu, MenuItemConstructorOptions, dialog} from 'electron';
import {app, BrowserWindow, shell, Menu, MenuItemConstructorOptions, dialog} from 'electron';
import {
is,
appMenu,
Expand Down Expand Up @@ -706,7 +706,7 @@ ${debugInfo()}`;
aboutMenuItem({
icon: caprineIconPath,
copyright: 'Created by Sindre Sorhus',
text: 'Maintainers:\nDušan Simić\nLefteris Garyfalakis\nMichael Quevillon\nNikolas Spiridakis',
text: 'Maintainers:\nDušan Simić\nLefteris Garyfalakis\nMichael Quevillon\nNikolas Spiridakis\nAlexander Frick',
website: 'https://sindresorhus.com/caprine',
}),
);
Expand Down Expand Up @@ -744,6 +744,16 @@ ${debugInfo()}`;
app.quit();
},
},
{
type: 'separator',
},
{
label: 'Open chrome://gpu',
click() {
const gpuWindow = new BrowserWindow({width: 1024, height: 768});
gpuWindow.loadURL('chrome://gpu');
},
},
];

const macosTemplate: MenuItemConstructorOptions[] = [
Expand Down
Binary file added static/icon.ico
Binary file not shown.