Skip to content

Commit

Permalink
chore: Update project name and refactor code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FormalSnake committed Jan 5, 2025
1 parent f6853f4 commit fe2e564
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dev-app-update.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
provider: generic
url: https://example.com/auto-updates
updaterCacheDirName: formalsurf-refactor-updater
updaterCacheDirName: formalsurf-updater
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ async function createWindow(): Promise<void> {
sandbox: false,
webviewTag: true,
nodeIntegration: true,
contextIsolation: false
contextIsolation: false,
experimentalFeatures: true,
}
})

Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit fe2e564

Please sign in to comment.