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

FEL (Fifo Extension Layer) v3 #202

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@fortawesome/free-regular-svg-icons": "6.2.0",
"@fortawesome/free-solid-svg-icons": "6.2.0",
"@fortawesome/react-fontawesome": "0.2.0",
"electron-chrome-extensions": "3.9.0",
"@snaildos/fel": "3.0.1",
"node-polyfill-webpack-plugin": "1.1.4",
"postinstall-postinstall": "2.1.0",
"react-query": "3.34.13",
Expand Down
14 changes: 14 additions & 0 deletions patches/@snaildos+fel+3.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/node_modules/@snaildos/fel/dist/index.js b/node_modules/@snaildos/fel/dist/index.js
index 1f98afa..9857051 100644
--- a/node_modules/@snaildos/fel/dist/index.js
+++ b/node_modules/@snaildos/fel/dist/index.js
@@ -2665,7 +2665,8 @@ class TabsAPI {
this.onRemoved(tabId);
});
this.onCreated(tabId);
- this.onActivated(tabId);
+ const activeTab = this.ctx.store.getActiveTabFromWebContents(tab)
+ if (activeTab?.id === tabId) this.onActivated(tabId);
debug(`Observing tab[${tabId}][${tab.getType()}] ${tab.getURL()}`);
}

14 changes: 0 additions & 14 deletions patches/electron-chrome-extensions+3.9.0.patch

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/sessions-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { extractZip } from '~/utils/zip';
import { requestPermission } from './dialogs/permissions';
import * as rimraf from 'rimraf';
import { promisify } from 'util';
import { ElectronChromeExtensions } from 'electron-chrome-extensions';
import { ElectronChromeExtensions } from '@snaildos/fel';

const rf = promisify(rimraf);

Expand Down
6 changes: 3 additions & 3 deletions src/main/windows-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { AppWindow } from './windows/app';
import { app, BrowserWindow, ipcMain } from 'electron';
import { SessionsService } from './sessions-service';
import { ElectronChromeExtensions } from 'electron-chrome-extensions';
import { ElectronChromeExtensions } from '@snaildos/fel';

export class WindowsService {
public list: AppWindow[] = [];
Expand All @@ -15,14 +15,14 @@ export class WindowsService {
constructor(sessions: SessionsService) {
if (process.env.ENABLE_EXTENSIONS) {
sessions.chromeExtensions = new ElectronChromeExtensions({
modulePath: `${app.getAppPath()}/node_modules/electron-chrome-extensions`,
modulePath: `${app.getAppPath()}/node_modules/@snaildos/fel`,
session: sessions.view,
createTab: async (details) => {
const win =
this.list.find((x) => x.win.id === details.windowId) ||
this.lastFocused;

if (!win) throw new Error('Window not found');
if (!win) throw new Error('Window Not Found');
const view = win.viewManager.create(details, false, false);
win.webContents.send(
'create-tab',
Expand Down
34 changes: 34 additions & 0 deletions src/renderer/constants/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,37 @@ export const lavTheme: ITheme = {
backgroundColor: '#1c1c1c',
accentColor: BLUE_500,
};

export const amoledTheme: ITheme = {
'titlebar.backgroundColor': '#000000',
'addressbar.backgroundColor': '#161616',
'addressbar.textColor': '#fff',
'toolbar.backgroundColor': '#111111',
'toolbar.bottomLine.backgroundColor': 'rgba(255, 255, 255, 0.08)',
'toolbar.lightForeground': true,
'toolbar.separator.color': '#ffffff',
'tab.selected.textColor': '#fff',
'tab.textColor': 'rgba(255, 255, 255, 0.54)',
'control.backgroundColor': 'rgba(255, 255, 255, 0.1)',
'control.hover.backgroundColor': 'rgba(255, 255, 255, 0.12)',
'control.valueColor': '#cfcfcf',
'control.lightIcon': true,
'switch.backgroundColor': '#111111',
'dialog.backgroundColor': '#212121',
'dialog.separator.color': 'rgba(255, 255, 255, 0.12)',
'dialog.textColor': '#fff',
'dialog.lightForeground': true,
'searchBox.backgroundColor': '#262626',
'searchBox.lightForeground': true,
'pages.backgroundColor': '#191818',
'pages.lightForeground': true,
'pages.textColor': '#fff',
'dropdown.backgroundColor': 'rgb(10, 10, 10)',
'dropdown.backgroundColor.translucent': 'rgb(30, 30, 30, 0.3)',
'dropdown.separator.color': 'rgba(255, 255, 255, 0.12)',
'pages.navigationDrawer1.backgroundColor': 'rgba(255, 255, 255, 0.1)',
'pages.navigationDrawer2.backgroundColor': 'rgba(255, 255, 255, 0.05)',

backgroundColor: '#000000',
accentColor: BLUE_500,
};