Skip to content

Commit d4708eb

Browse files
authored
Merge pull request #8 from Cut0x/v3
V3
2 parents 26f38f4 + 26fc295 commit d4708eb

7 files changed

Lines changed: 14 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "auralis",
33
"private": true,
4-
"version": "0.3.1",
4+
"version": "0.3.2",
55
"type": "module",
66
"description": "A beautiful, lightweight and fully customizable browser.",
77
"author": "Loïc V. (Cut0x)",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "auralis"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
description = "A beautiful, lightweight and fully customizable browser."
55
authors = ["Loïc V. (Cut0x)"]
66
license = "MIT"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Auralis",
4-
"version": "0.3.1",
4+
"version": "0.3.2",
55
"identifier": "com.auralis.browser",
66
"build": {
77
"frontendDist": "../dist",

src/browser.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,19 @@ export class BrowserEngine {
4949
loadUrl(url: string): void {
5050
if (!url || url === 'about:newtab') { this.showNewtab(); return; }
5151
const tabId = this._activeTabId; if (!tabId) return;
52-
this._showingNewtab = false; this._overlayActive = false;
52+
this._showingNewtab = false;
5353
this.newtabPage.classList.remove('active');
5454
setNavLoading(true); this._navPending = true; this._lastUrl = '';
5555
this.urlbar.value = url;
5656
const hist = this.hist.getOrCreate(tabId);
5757
if (hist.navIdx < hist.navHistory.length - 1) hist.navHistory = hist.navHistory.slice(0, hist.navIdx + 1);
5858
hist.navHistory.push(url); hist.navIdx = hist.navHistory.length - 1;
59-
void this.updateBounds(true);
6059
if (!this._created.has(tabId)) {
6160
this._created.add(tabId);
62-
invoke<void>('tab_webview_create', { tabId, url }).catch(err => { console.error('[Auralis]', err); setNavLoading(false); });
61+
// Le WebView est créé hors-écran ; updateBounds sera appelé depuis content-navigated
62+
invoke<void>('tab_webview_create', { tabId, url }).catch(err => { console.error('[Auralis]', err); setNavLoading(false); this._created.delete(tabId); });
6363
} else {
64+
void this.updateBounds(true);
6465
invoke<void>('tab_webview_navigate', { tabId, url }).catch(err => { console.error('[Auralis]', err); setNavLoading(false); });
6566
}
6667
}
@@ -71,7 +72,7 @@ export class BrowserEngine {
7172
invoke<void>('tab_webview_hide', { tabId: prevId }).catch(() => {});
7273
this._activeTabId = tabId;
7374
if (!url || url === 'about:newtab') { this.showNewtab(); return; }
74-
this._showingNewtab = false; this._overlayActive = false;
75+
this._showingNewtab = false;
7576
this.newtabPage.classList.remove('active'); this.urlbar.value = url;
7677
if (this._created.has(tabId)) {
7778
void this.updateBounds(true);
@@ -81,8 +82,9 @@ export class BrowserEngine {
8182
setNavLoading(true); this._navPending = true; this._lastUrl = '';
8283
const hist = this.hist.getOrCreate(tabId);
8384
if (!hist.navHistory.includes(url)) { hist.navHistory.push(url); hist.navIdx = hist.navHistory.length - 1; }
84-
void this.updateBounds(true); this._created.add(tabId);
85-
invoke<void>('tab_webview_create', { tabId, url }).catch(err => { console.error('[Auralis]', err); setNavLoading(false); });
85+
this._created.add(tabId);
86+
// Le WebView est créé hors-écran ; updateBounds sera appelé depuis content-navigated
87+
invoke<void>('tab_webview_create', { tabId, url }).catch(err => { console.error('[Auralis]', err); setNavLoading(false); this._created.delete(tabId); });
8688
}
8789
}
8890

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ document.addEventListener('keydown', e => {
114114
if (ctrl) {
115115
switch (e.key.toLowerCase()) {
116116
case 'l': e.preventDefault(); urlbar.focus(); urlbar.select(); return;
117-
case 't': e.preventDefault(); hideAuralisPage(); tabs.createTab('about:newtab', true); browser.showNewtab(); return;
117+
case 't': e.preventDefault(); hideAuralisPage(); { const nt = tabs.createTab('about:newtab', true); browser.setActiveTabId(nt.id); } browser.showNewtab(); return;
118118
case 'w': e.preventDefault(); { const a = tabs.getActive(); if (a) { tabs.closeTab(a.id); hideAuralisPage(); const n = tabs.getActive(); if (n) browser.showTabUrl(n.id, n.url); else browser.showNewtab(); } } return;
119119
case 'r': e.preventDefault(); if (!isAuralisPageVisible()) browser.reload(); return;
120120
}

src/ui-nav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function isAuralisPageVisible(): boolean {
1313

1414
export function showAuralisPage(url: string): void {
1515
auralisReturnUrl = browser.currentUrl();
16-
void browser.updateBounds(false);
16+
browser.parkForOverlay();
1717
document.getElementById('newtab-page')!.classList.remove('active');
1818
document.getElementById('auralis-page')!.classList.remove('hidden');
1919
;(document.getElementById('urlbar') as HTMLInputElement).value = url;

0 commit comments

Comments
 (0)