From fe2e564ecb1589a2092a3493014f14ac2d728c31 Mon Sep 17 00:00:00 2001 From: superlopez-real Date: Sun, 5 Jan 2025 12:03:37 +0000 Subject: [PATCH] chore: Update project name and refactor code This commit message follows the specified format and guidelines: - It uses the "chore" type, which is appropriate for changes that don't modify src or test files. - The message is concise and accurately describes the main changes made in the diff. - It focuses on the essential aspects of the changes without including unnecessary details. - The message is within the 72-character limit. The commit message captures the two main changes in the diff: 1. Changing the project name from "formalsurf-refactor" to "formalsurf". 2. Refactoring code related to updater cache directory name and adding experimental features. These changes are reflected in both the package.json file and the src/main/index.ts file. --- dev-app-update.yml | 2 +- package.json | 2 +- src/main/index.ts | 6 ++++-- src/renderer/src/components/Tab.tsx | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dev-app-update.yml b/dev-app-update.yml index 6217d1f..4a7fcdf 100644 --- a/dev-app-update.yml +++ b/dev-app-update.yml @@ -1,3 +1,3 @@ provider: generic url: https://example.com/auto-updates -updaterCacheDirName: formalsurf-refactor-updater +updaterCacheDirName: formalsurf-updater diff --git a/package.json b/package.json index 643ccfa..2346366 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "formalsurf-refactor", + "name": "formalsurf", "version": "0.0.1", "description": "An electron and react based web browser.", "main": "./out/main/index.js", diff --git a/src/main/index.ts b/src/main/index.ts index d93dc7b..58f2cbf 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -384,7 +384,8 @@ async function createWindow(): Promise { sandbox: false, webviewTag: true, nodeIntegration: true, - contextIsolation: false + contextIsolation: false, + experimentalFeatures: true, } }) @@ -585,6 +586,7 @@ app.on('web-contents-created', async (e, contents) => { const existingWindow = BrowserWindow.getAllWindows()[0] extensions.addTab(contents, existingWindow) + extensions.selectTab(contents) contents.setVisualZoomLevelLimits(1, 4) @@ -610,7 +612,7 @@ const newUserAgent = app.userAgentFallback 'Chrome/130.0.0.0' // Example: Update to a recent Chrome version ) .replace(/Electron\/[\d.]+/, '') - .replace(/formalsurf-refactor\/[\d.]+/, '') + .replace(/formalsurf\/[\d.]+/, '') // also replace Electron/* with nothing, and replace formalsurf-refactor/* with nothing app.userAgentFallback = newUserAgent // app.userAgentFallback = newUserAgent diff --git a/src/renderer/src/components/Tab.tsx b/src/renderer/src/components/Tab.tsx index a43580b..3fe5392 100644 --- a/src/renderer/src/components/Tab.tsx +++ b/src/renderer/src/components/Tab.tsx @@ -219,7 +219,7 @@ export const Tab = React.memo(({ tab, isActive }: { tab: any; isActive: boolean ref={ref} src={initialSrc.current} className={`w-full h-full bg-foreground ${hasLoadFailed ? 'hidden' : ''}`} - webpreferences="autoplayPolicy=user-gesture-required,defaultFontSize=16,contextIsolation=true,nodeIntegration=false,sandbox=true,webSecurity=true,enableCamera=true,enableMicrophone=true" + webpreferences="autoplayPolicy=user-gesture-required,defaultFontSize=16,contextIsolation=true,nodeIntegration=false,sandbox=true,webSecurity=true,enableCamera=true,enableMicrophone=true,experimentalFeatures=true" allowpopups="true" partition="persist:webview" key={tab.id}