incognitoMode

This commit is contained in:
DASHU
2025-04-30 22:08:17 +08:00
parent 0f872941ee
commit 78e0b83e16
38 changed files with 163 additions and 91 deletions

View File

@@ -75,7 +75,7 @@ class _LongPressDialog extends State<LongPressDialog> {
}, },
)); ));
list.add(LongPressDialogItem( list.add(LongPressDialogItem(
s.Open_with_Stealth_Mode, s.Open_with_Incognito_Mode,
onTap: () { onTap: () {
webProvider.addTab(url: url); webProvider.addTab(url: url);
}, },

View File

@@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import '../../data/browser_history.dart'; import '../../data/browser_history.dart';
import 'webview_controller_interface.dart'; import 'webview_controller_interface.dart';
@@ -7,7 +8,12 @@ class WebInfo {
String url; String url;
WebInfo(this.id, this.url); bool incognitoMode;
bool isSecure;
WebInfo(this.id, this.url,
{this.incognitoMode = false, this.isSecure = false});
WebviewControllerInterface? controller; WebviewControllerInterface? controller;
@@ -22,4 +28,12 @@ class WebInfo {
wi.browserHistory = browserHistory; wi.browserHistory = browserHistory;
return wi; return wi;
} }
Color? getBackgroundColor() {
if (incognitoMode) {
return Colors.grey;
} else {
return null;
}
}
} }

View File

@@ -27,12 +27,15 @@ class WebViewComponent extends StatefulWidget {
Function(WebInfo, InAppWebViewController, String?) onTitleChanged; Function(WebInfo, InAppWebViewController, String?) onTitleChanged;
Function(WebInfo, InAppWebViewController, WebUri? url) onLoadStart;
Function(WebInfo, InAppWebViewController) onLoadStop; Function(WebInfo, InAppWebViewController) onLoadStop;
WebViewComponent( WebViewComponent(
this.webInfo, this.webInfo,
this.onWebViewCreated, this.onWebViewCreated,
this.onTitleChanged, this.onTitleChanged,
this.onLoadStart,
this.onLoadStop, this.onLoadStop,
); );
@@ -131,6 +134,8 @@ class _WebViewComponent extends State<WebViewComponent>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
settings.incognito = widget.webInfo.incognitoMode;
return Container( return Container(
child: InAppWebView( child: InAppWebView(
initialUrlRequest: URLRequest(url: WebUri(widget.webInfo.url)), initialUrlRequest: URLRequest(url: WebUri(widget.webInfo.url)),
@@ -146,7 +151,9 @@ class _WebViewComponent extends State<WebViewComponent>
onTitleChanged: (controller, title) { onTitleChanged: (controller, title) {
widget.onTitleChanged(widget.webInfo, controller, title); widget.onTitleChanged(widget.webInfo, controller, title);
}, },
onLoadStart: (controller, url) async {}, onLoadStart: (controller, url) async {
widget.onLoadStart(widget.webInfo, controller, url);
},
onPermissionRequest: (controller, request) async { onPermissionRequest: (controller, request) async {
return PermissionResponse( return PermissionResponse(
resources: request.resources, resources: request.resources,

View File

@@ -134,7 +134,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("توقيع الحدث"), "Sign_Event": MessageLookupByLibrary.simpleMessage("توقيع الحدث"),
"Stars": MessageLookupByLibrary.simpleMessage("حفظ العناوين"), "Stars": MessageLookupByLibrary.simpleMessage("حفظ العناوين"),
"Stealth": MessageLookupByLibrary.simpleMessage("خلسة"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("نوع الموضوع"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("نوع الموضوع"),
"Url": MessageLookupByLibrary.simpleMessage("لينك ."), "Url": MessageLookupByLibrary.simpleMessage("لينك ."),
"WEB": MessageLookupByLibrary.simpleMessage("صفحة ويب"), "WEB": MessageLookupByLibrary.simpleMessage("صفحة ويب"),

View File

@@ -150,7 +150,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Подписване на събитие"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Подписване на събитие"),
"Stars": MessageLookupByLibrary.simpleMessage("запис на отметка"), "Stars": MessageLookupByLibrary.simpleMessage("запис на отметка"),
"Stealth": MessageLookupByLibrary.simpleMessage("невидими"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Вид тема"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Вид тема"),
"Url": MessageLookupByLibrary.simpleMessage("връзка"), "Url": MessageLookupByLibrary.simpleMessage("връзка"),
"WEB": MessageLookupByLibrary.simpleMessage("уеб страница"), "WEB": MessageLookupByLibrary.simpleMessage("уеб страница"),

View File

@@ -138,7 +138,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Podpis události"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Podpis události"),
"Stars": MessageLookupByLibrary.simpleMessage("Uložit záložku"), "Stars": MessageLookupByLibrary.simpleMessage("Uložit záložku"),
"Stealth": MessageLookupByLibrary.simpleMessage("Nevytnost"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Typ tématu"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Typ tématu"),
"Url": MessageLookupByLibrary.simpleMessage("odkaz"), "Url": MessageLookupByLibrary.simpleMessage("odkaz"),
"WEB": MessageLookupByLibrary.simpleMessage("Webové stránky"), "WEB": MessageLookupByLibrary.simpleMessage("Webové stránky"),

View File

@@ -136,7 +136,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Signatur begivenhed"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Signatur begivenhed"),
"Stars": MessageLookupByLibrary.simpleMessage("Gem bogmærker"), "Stars": MessageLookupByLibrary.simpleMessage("Gem bogmærker"),
"Stealth": MessageLookupByLibrary.simpleMessage("Skyldig"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Tematype"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Tematype"),
"Url": MessageLookupByLibrary.simpleMessage("Links"), "Url": MessageLookupByLibrary.simpleMessage("Links"),
"WEB": MessageLookupByLibrary.simpleMessage("hjemmeside"), "WEB": MessageLookupByLibrary.simpleMessage("hjemmeside"),

View File

@@ -152,7 +152,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Signatur Ereignis"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Signatur Ereignis"),
"Stars": MessageLookupByLibrary.simpleMessage("Lesezeichen speichern"), "Stars": MessageLookupByLibrary.simpleMessage("Lesezeichen speichern"),
"Stealth": MessageLookupByLibrary.simpleMessage("Unsichtbar"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Thementyp"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Thementyp"),
"Url": MessageLookupByLibrary.simpleMessage("Links"), "Url": MessageLookupByLibrary.simpleMessage("Links"),
"WEB": MessageLookupByLibrary.simpleMessage("Webseite"), "WEB": MessageLookupByLibrary.simpleMessage("Webseite"),

View File

@@ -146,7 +146,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Εκδήλωση υπογραφής"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Εκδήλωση υπογραφής"),
"Stars": MessageLookupByLibrary.simpleMessage("αποθήκευση σελιδοδείκτη"), "Stars": MessageLookupByLibrary.simpleMessage("αποθήκευση σελιδοδείκτη"),
"Stealth": MessageLookupByLibrary.simpleMessage("Ακρυφότητα"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Τύπος θέματος"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Τύπος θέματος"),
"Url": MessageLookupByLibrary.simpleMessage("σύνδεση"), "Url": MessageLookupByLibrary.simpleMessage("σύνδεση"),
"WEB": MessageLookupByLibrary.simpleMessage("Ιστοσελίδα"), "WEB": MessageLookupByLibrary.simpleMessage("Ιστοσελίδα"),

View File

@@ -88,6 +88,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Get_Public_Key": MessageLookupByLibrary.simpleMessage("Get Public Key"), "Get_Public_Key": MessageLookupByLibrary.simpleMessage("Get Public Key"),
"Get_Relays": MessageLookupByLibrary.simpleMessage("Get Relays"), "Get_Relays": MessageLookupByLibrary.simpleMessage("Get Relays"),
"Historys": MessageLookupByLibrary.simpleMessage("Historys"), "Historys": MessageLookupByLibrary.simpleMessage("Historys"),
"Incognito": MessageLookupByLibrary.simpleMessage("Incognito"),
"Input_can_not_be_null": MessageLookupByLibrary.simpleMessage( "Input_can_not_be_null": MessageLookupByLibrary.simpleMessage(
"Input can\'t be null", "Input can\'t be null",
), ),
@@ -109,8 +110,8 @@ class MessageLookup extends MessageLookupByLibrary {
"Open_in_a_New_Tab": MessageLookupByLibrary.simpleMessage( "Open_in_a_New_Tab": MessageLookupByLibrary.simpleMessage(
"Open in a New Tab", "Open in a New Tab",
), ),
"Open_with_Stealth_Mode": MessageLookupByLibrary.simpleMessage( "Open_with_Incognito_Mode": MessageLookupByLibrary.simpleMessage(
"Open with Stealth Mode", "Open with Incognito Mode",
), ),
"Pendding_connect_remote_apps": MessageLookupByLibrary.simpleMessage( "Pendding_connect_remote_apps": MessageLookupByLibrary.simpleMessage(
"Pendding connect remote apps", "Pendding connect remote apps",
@@ -135,7 +136,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("Show more logs"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("Show more logs"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Sign Event"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Sign Event"),
"Stars": MessageLookupByLibrary.simpleMessage("Stars"), "Stars": MessageLookupByLibrary.simpleMessage("Stars"),
"Stealth": MessageLookupByLibrary.simpleMessage("Stealth"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("ThemeStyle"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("ThemeStyle"),
"Url": MessageLookupByLibrary.simpleMessage("Url"), "Url": MessageLookupByLibrary.simpleMessage("Url"),
"WEB": MessageLookupByLibrary.simpleMessage("WEB"), "WEB": MessageLookupByLibrary.simpleMessage("WEB"),

View File

@@ -150,7 +150,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Evento de firma"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Evento de firma"),
"Stars": MessageLookupByLibrary.simpleMessage("Guardar marcadores"), "Stars": MessageLookupByLibrary.simpleMessage("Guardar marcadores"),
"Stealth": MessageLookupByLibrary.simpleMessage("Sigiloso"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Tipo de tema"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Tipo de tema"),
"Url": MessageLookupByLibrary.simpleMessage("Enlaces"), "Url": MessageLookupByLibrary.simpleMessage("Enlaces"),
"WEB": MessageLookupByLibrary.simpleMessage("Página web"), "WEB": MessageLookupByLibrary.simpleMessage("Página web"),

View File

@@ -140,7 +140,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Allkirja sündmus"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Allkirja sündmus"),
"Stars": MessageLookupByLibrary.simpleMessage("Järjehoidja salvestamine"), "Stars": MessageLookupByLibrary.simpleMessage("Järjehoidja salvestamine"),
"Stealth": MessageLookupByLibrary.simpleMessage("varjatus"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Teema tüüp"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Teema tüüp"),
"Url": MessageLookupByLibrary.simpleMessage("lingid"), "Url": MessageLookupByLibrary.simpleMessage("lingid"),
"WEB": MessageLookupByLibrary.simpleMessage("Veebilehekülg"), "WEB": MessageLookupByLibrary.simpleMessage("Veebilehekülg"),

View File

@@ -142,7 +142,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Allekirjoittaa tapahtuma", "Allekirjoittaa tapahtuma",
), ),
"Stars": MessageLookupByLibrary.simpleMessage("Tallenna kirjanmerkki"), "Stars": MessageLookupByLibrary.simpleMessage("Tallenna kirjanmerkki"),
"Stealth": MessageLookupByLibrary.simpleMessage("Piiloton"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Teematyyppi"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Teematyyppi"),
"Url": MessageLookupByLibrary.simpleMessage("Linkkejä"), "Url": MessageLookupByLibrary.simpleMessage("Linkkejä"),
"WEB": MessageLookupByLibrary.simpleMessage("Verkkosivu"), "WEB": MessageLookupByLibrary.simpleMessage("Verkkosivu"),

View File

@@ -154,7 +154,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Événements signés"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Événements signés"),
"Stars": MessageLookupByLibrary.simpleMessage("Sauvegarder les signets"), "Stars": MessageLookupByLibrary.simpleMessage("Sauvegarder les signets"),
"Stealth": MessageLookupByLibrary.simpleMessage("Furtivité"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Type de thème"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Type de thème"),
"Url": MessageLookupByLibrary.simpleMessage("Liens"), "Url": MessageLookupByLibrary.simpleMessage("Liens"),
"WEB": MessageLookupByLibrary.simpleMessage("Page Web"), "WEB": MessageLookupByLibrary.simpleMessage("Page Web"),

View File

@@ -150,7 +150,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Aláírási esemény"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Aláírási esemény"),
"Stars": MessageLookupByLibrary.simpleMessage("Könyvjelző mentése"), "Stars": MessageLookupByLibrary.simpleMessage("Könyvjelző mentése"),
"Stealth": MessageLookupByLibrary.simpleMessage("rejthetetlen"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Téma típusa"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Téma típusa"),
"Url": MessageLookupByLibrary.simpleMessage("hivatkozások"), "Url": MessageLookupByLibrary.simpleMessage("hivatkozások"),
"WEB": MessageLookupByLibrary.simpleMessage("weboldal"), "WEB": MessageLookupByLibrary.simpleMessage("weboldal"),

View File

@@ -150,7 +150,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("Mostra altri log"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("Mostra altri log"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Firma dell\' evento"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Firma dell\' evento"),
"Stars": MessageLookupByLibrary.simpleMessage("Salva segnalibri"), "Stars": MessageLookupByLibrary.simpleMessage("Salva segnalibri"),
"Stealth": MessageLookupByLibrary.simpleMessage("Invisibile"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Tipo di argomento"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Tipo di argomento"),
"Url": MessageLookupByLibrary.simpleMessage("Collegamenti"), "Url": MessageLookupByLibrary.simpleMessage("Collegamenti"),
"WEB": MessageLookupByLibrary.simpleMessage("Pagina web"), "WEB": MessageLookupByLibrary.simpleMessage("Pagina web"),

View File

@@ -106,7 +106,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("詳細なログを表示"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("詳細なログを表示"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("署名イベント"), "Sign_Event": MessageLookupByLibrary.simpleMessage("署名イベント"),
"Stars": MessageLookupByLibrary.simpleMessage("ブックマークの保存"), "Stars": MessageLookupByLibrary.simpleMessage("ブックマークの保存"),
"Stealth": MessageLookupByLibrary.simpleMessage("身を隠す"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("トピック・タイプ"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("トピック・タイプ"),
"Url": MessageLookupByLibrary.simpleMessage("リンク#リンク#"), "Url": MessageLookupByLibrary.simpleMessage("リンク#リンク#"),
"WEB": MessageLookupByLibrary.simpleMessage("Webページ"), "WEB": MessageLookupByLibrary.simpleMessage("Webページ"),

View File

@@ -108,7 +108,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("추가 로그 표시"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("추가 로그 표시"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("서명 이벤트"), "Sign_Event": MessageLookupByLibrary.simpleMessage("서명 이벤트"),
"Stars": MessageLookupByLibrary.simpleMessage("책갈피 저장"), "Stars": MessageLookupByLibrary.simpleMessage("책갈피 저장"),
"Stealth": MessageLookupByLibrary.simpleMessage("은신"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("주제 유형"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("주제 유형"),
"Url": MessageLookupByLibrary.simpleMessage("링크"), "Url": MessageLookupByLibrary.simpleMessage("링크"),
"WEB": MessageLookupByLibrary.simpleMessage("웹 페이지"), "WEB": MessageLookupByLibrary.simpleMessage("웹 페이지"),

View File

@@ -140,7 +140,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Gebeurtenissen ondertekenen", "Gebeurtenissen ondertekenen",
), ),
"Stars": MessageLookupByLibrary.simpleMessage("Bladwizers opslaan"), "Stars": MessageLookupByLibrary.simpleMessage("Bladwizers opslaan"),
"Stealth": MessageLookupByLibrary.simpleMessage("Onzichtbaar"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Type onderwerp"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Type onderwerp"),
"Url": MessageLookupByLibrary.simpleMessage("Links"), "Url": MessageLookupByLibrary.simpleMessage("Links"),
"WEB": MessageLookupByLibrary.simpleMessage("Webpagina"), "WEB": MessageLookupByLibrary.simpleMessage("Webpagina"),

View File

@@ -148,7 +148,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Podpisanie zdarzenia"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Podpisanie zdarzenia"),
"Stars": MessageLookupByLibrary.simpleMessage("Zapisz zakładkę"), "Stars": MessageLookupByLibrary.simpleMessage("Zapisz zakładkę"),
"Stealth": MessageLookupByLibrary.simpleMessage("niewidzialny"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Typ tematu"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Typ tematu"),
"Url": MessageLookupByLibrary.simpleMessage("Linki"), "Url": MessageLookupByLibrary.simpleMessage("Linki"),
"WEB": MessageLookupByLibrary.simpleMessage("Strona internetowa"), "WEB": MessageLookupByLibrary.simpleMessage("Strona internetowa"),

View File

@@ -144,7 +144,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Evento de assinatura"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Evento de assinatura"),
"Stars": MessageLookupByLibrary.simpleMessage("Salvar favoritos"), "Stars": MessageLookupByLibrary.simpleMessage("Salvar favoritos"),
"Stealth": MessageLookupByLibrary.simpleMessage("invisível"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Tipo de tema"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Tipo de tema"),
"Url": MessageLookupByLibrary.simpleMessage("Ligação"), "Url": MessageLookupByLibrary.simpleMessage("Ligação"),
"WEB": MessageLookupByLibrary.simpleMessage("Páginas Web"), "WEB": MessageLookupByLibrary.simpleMessage("Páginas Web"),

View File

@@ -152,7 +152,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Evenimente de semnare"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Evenimente de semnare"),
"Stars": MessageLookupByLibrary.simpleMessage("Salvare marcare"), "Stars": MessageLookupByLibrary.simpleMessage("Salvare marcare"),
"Stealth": MessageLookupByLibrary.simpleMessage("stealth"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Tip de subiect"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Tip de subiect"),
"Url": MessageLookupByLibrary.simpleMessage("link"), "Url": MessageLookupByLibrary.simpleMessage("link"),
"WEB": MessageLookupByLibrary.simpleMessage("paginile web"), "WEB": MessageLookupByLibrary.simpleMessage("paginile web"),

View File

@@ -148,7 +148,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Событие подписи"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Событие подписи"),
"Stars": MessageLookupByLibrary.simpleMessage("Сохранить закладки"), "Stars": MessageLookupByLibrary.simpleMessage("Сохранить закладки"),
"Stealth": MessageLookupByLibrary.simpleMessage("Скрытие"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Тип темы"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Тип темы"),
"Url": MessageLookupByLibrary.simpleMessage("Ссылки"), "Url": MessageLookupByLibrary.simpleMessage("Ссылки"),
"WEB": MessageLookupByLibrary.simpleMessage("Веб - страница"), "WEB": MessageLookupByLibrary.simpleMessage("Веб - страница"),

View File

@@ -142,7 +142,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Dogodek podpisa"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Dogodek podpisa"),
"Stars": MessageLookupByLibrary.simpleMessage("shrani zaznamek"), "Stars": MessageLookupByLibrary.simpleMessage("shrani zaznamek"),
"Stealth": MessageLookupByLibrary.simpleMessage("nevidni"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Vrsta teme"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Vrsta teme"),
"Url": MessageLookupByLibrary.simpleMessage("povezava"), "Url": MessageLookupByLibrary.simpleMessage("povezava"),
"WEB": MessageLookupByLibrary.simpleMessage("Spletna stran"), "WEB": MessageLookupByLibrary.simpleMessage("Spletna stran"),

View File

@@ -146,7 +146,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("Visa fler loggar"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("Visa fler loggar"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Signaturhändelse"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Signaturhändelse"),
"Stars": MessageLookupByLibrary.simpleMessage("Spara bokmärke"), "Stars": MessageLookupByLibrary.simpleMessage("Spara bokmärke"),
"Stealth": MessageLookupByLibrary.simpleMessage("Osymlig"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Ämnestyp"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Ämnestyp"),
"Url": MessageLookupByLibrary.simpleMessage("länk"), "Url": MessageLookupByLibrary.simpleMessage("länk"),
"WEB": MessageLookupByLibrary.simpleMessage("Webbplatser"), "WEB": MessageLookupByLibrary.simpleMessage("Webbplatser"),

View File

@@ -136,7 +136,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("กิจกรรมลายเซ็น"), "Sign_Event": MessageLookupByLibrary.simpleMessage("กิจกรรมลายเซ็น"),
"Stars": MessageLookupByLibrary.simpleMessage("บันทึกที่คั่นหน้า"), "Stars": MessageLookupByLibrary.simpleMessage("บันทึกที่คั่นหน้า"),
"Stealth": MessageLookupByLibrary.simpleMessage("ชิงทรัพย์"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("ประเภทหัวข้อ"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("ประเภทหัวข้อ"),
"Url": MessageLookupByLibrary.simpleMessage("ลิงค์"), "Url": MessageLookupByLibrary.simpleMessage("ลิงค์"),
"WEB": MessageLookupByLibrary.simpleMessage("เว็บเพจ"), "WEB": MessageLookupByLibrary.simpleMessage("เว็บเพจ"),

View File

@@ -124,7 +124,6 @@ class MessageLookup extends MessageLookupByLibrary {
), ),
"Sign_Event": MessageLookupByLibrary.simpleMessage("Sự kiện chữ ký"), "Sign_Event": MessageLookupByLibrary.simpleMessage("Sự kiện chữ ký"),
"Stars": MessageLookupByLibrary.simpleMessage("Lưu Đánh dấu"), "Stars": MessageLookupByLibrary.simpleMessage("Lưu Đánh dấu"),
"Stealth": MessageLookupByLibrary.simpleMessage("Tàng hình"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("Loại chủ đề"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("Loại chủ đề"),
"Url": MessageLookupByLibrary.simpleMessage("Liên kết"), "Url": MessageLookupByLibrary.simpleMessage("Liên kết"),
"WEB": MessageLookupByLibrary.simpleMessage("Trang web"), "WEB": MessageLookupByLibrary.simpleMessage("Trang web"),

View File

@@ -50,6 +50,8 @@ class MessageLookup extends MessageLookupByLibrary {
"Confirm": MessageLookupByLibrary.simpleMessage("确认"), "Confirm": MessageLookupByLibrary.simpleMessage("确认"),
"ConnectType": MessageLookupByLibrary.simpleMessage("链接类型"), "ConnectType": MessageLookupByLibrary.simpleMessage("链接类型"),
"Connect_by": MessageLookupByLibrary.simpleMessage("链接"), "Connect_by": MessageLookupByLibrary.simpleMessage("链接"),
"Copy_Link": MessageLookupByLibrary.simpleMessage("复制链接"),
"Copy_Title": MessageLookupByLibrary.simpleMessage("复制标题"),
"Copy_success": MessageLookupByLibrary.simpleMessage("复制成功"), "Copy_success": MessageLookupByLibrary.simpleMessage("复制成功"),
"Custom": MessageLookupByLibrary.simpleMessage("自定义"), "Custom": MessageLookupByLibrary.simpleMessage("自定义"),
"Dark": MessageLookupByLibrary.simpleMessage("深色"), "Dark": MessageLookupByLibrary.simpleMessage("深色"),
@@ -57,6 +59,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Decrypt44_name": MessageLookupByLibrary.simpleMessage("解密 (NIP-44)"), "Decrypt44_name": MessageLookupByLibrary.simpleMessage("解密 (NIP-44)"),
"Decrypt_zap_event": MessageLookupByLibrary.simpleMessage("解密私密Zap"), "Decrypt_zap_event": MessageLookupByLibrary.simpleMessage("解密私密Zap"),
"Desktop": MessageLookupByLibrary.simpleMessage("桌面"), "Desktop": MessageLookupByLibrary.simpleMessage("桌面"),
"Download_image": MessageLookupByLibrary.simpleMessage("下载图片"),
"Downloads": MessageLookupByLibrary.simpleMessage("下载"), "Downloads": MessageLookupByLibrary.simpleMessage("下载"),
"Edit": MessageLookupByLibrary.simpleMessage("编辑"), "Edit": MessageLookupByLibrary.simpleMessage("编辑"),
"Encrypt04_name": MessageLookupByLibrary.simpleMessage("加密 (NIP-04)"), "Encrypt04_name": MessageLookupByLibrary.simpleMessage("加密 (NIP-04)"),
@@ -71,6 +74,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Get_Public_Key": MessageLookupByLibrary.simpleMessage("获取公钥"), "Get_Public_Key": MessageLookupByLibrary.simpleMessage("获取公钥"),
"Get_Relays": MessageLookupByLibrary.simpleMessage("获取中继"), "Get_Relays": MessageLookupByLibrary.simpleMessage("获取中继"),
"Historys": MessageLookupByLibrary.simpleMessage("历史"), "Historys": MessageLookupByLibrary.simpleMessage("历史"),
"Incognito": MessageLookupByLibrary.simpleMessage("无痕"),
"Input_can_not_be_null": MessageLookupByLibrary.simpleMessage("输入不能为空"), "Input_can_not_be_null": MessageLookupByLibrary.simpleMessage("输入不能为空"),
"Input_search_url_des": MessageLookupByLibrary.simpleMessage("请输入搜索链接"), "Input_search_url_des": MessageLookupByLibrary.simpleMessage("请输入搜索链接"),
"Keys_Manager": MessageLookupByLibrary.simpleMessage("秘钥管理"), "Keys_Manager": MessageLookupByLibrary.simpleMessage("秘钥管理"),
@@ -79,6 +83,10 @@ class MessageLookup extends MessageLookupByLibrary {
"Local_Relay": MessageLookupByLibrary.simpleMessage("本地中继"), "Local_Relay": MessageLookupByLibrary.simpleMessage("本地中继"),
"Login": MessageLookupByLibrary.simpleMessage("登录"), "Login": MessageLookupByLibrary.simpleMessage("登录"),
"Name": MessageLookupByLibrary.simpleMessage("名称"), "Name": MessageLookupByLibrary.simpleMessage("名称"),
"Open_backgroundly": MessageLookupByLibrary.simpleMessage("后台打开"),
"Open_image_in_a_New_Tab": MessageLookupByLibrary.simpleMessage("新标签打开图片"),
"Open_in_a_New_Tab": MessageLookupByLibrary.simpleMessage("打开新标签"),
"Open_with_Incognito_Mode": MessageLookupByLibrary.simpleMessage("无痕模式打开"),
"Pendding_connect_remote_apps": MessageLookupByLibrary.simpleMessage( "Pendding_connect_remote_apps": MessageLookupByLibrary.simpleMessage(
"待链接的远程应用", "待链接的远程应用",
), ),
@@ -98,7 +106,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("显示更多日志"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("显示更多日志"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("签名事件"), "Sign_Event": MessageLookupByLibrary.simpleMessage("签名事件"),
"Stars": MessageLookupByLibrary.simpleMessage("保存书签"), "Stars": MessageLookupByLibrary.simpleMessage("保存书签"),
"Stealth": MessageLookupByLibrary.simpleMessage("隐身"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("主题类型"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("主题类型"),
"Url": MessageLookupByLibrary.simpleMessage("链接"), "Url": MessageLookupByLibrary.simpleMessage("链接"),
"WEB": MessageLookupByLibrary.simpleMessage("网页"), "WEB": MessageLookupByLibrary.simpleMessage("网页"),

View File

@@ -98,7 +98,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Show_more_logs": MessageLookupByLibrary.simpleMessage("顯示更多日誌"), "Show_more_logs": MessageLookupByLibrary.simpleMessage("顯示更多日誌"),
"Sign_Event": MessageLookupByLibrary.simpleMessage("簽名事件"), "Sign_Event": MessageLookupByLibrary.simpleMessage("簽名事件"),
"Stars": MessageLookupByLibrary.simpleMessage("保存書簽"), "Stars": MessageLookupByLibrary.simpleMessage("保存書簽"),
"Stealth": MessageLookupByLibrary.simpleMessage("隱身"),
"ThemeStyle": MessageLookupByLibrary.simpleMessage("主題類型"), "ThemeStyle": MessageLookupByLibrary.simpleMessage("主題類型"),
"Url": MessageLookupByLibrary.simpleMessage("鏈接"), "Url": MessageLookupByLibrary.simpleMessage("鏈接"),
"WEB": MessageLookupByLibrary.simpleMessage("網頁"), "WEB": MessageLookupByLibrary.simpleMessage("網頁"),

View File

@@ -70,9 +70,9 @@ class S {
return Intl.message('Refresh', name: 'Refresh', desc: '', args: []); return Intl.message('Refresh', name: 'Refresh', desc: '', args: []);
} }
/// `Stealth` /// `Incognito`
String get Stealth { String get Incognito {
return Intl.message('Stealth', name: 'Stealth', desc: '', args: []); return Intl.message('Incognito', name: 'Incognito', desc: '', args: []);
} }
/// `Comming soon...` /// `Comming soon...`
@@ -665,11 +665,11 @@ class S {
); );
} }
/// `Open with Stealth Mode` /// `Open with Incognito Mode`
String get Open_with_Stealth_Mode { String get Open_with_Incognito_Mode {
return Intl.message( return Intl.message(
'Open with Stealth Mode', 'Open with Incognito Mode',
name: 'Open_with_Stealth_Mode', name: 'Open_with_Incognito_Mode',
desc: '', desc: '',
args: [], args: [],
); );

View File

@@ -2,7 +2,7 @@
"Back": "Back", "Back": "Back",
"Forward": "Forward", "Forward": "Forward",
"Refresh": "Refresh", "Refresh": "Refresh",
"Stealth": "Stealth", "Incognito": "Incognito",
"Comming_soon": "Comming soon...", "Comming_soon": "Comming soon...",
"Bookmarks": "Bookmarks", "Bookmarks": "Bookmarks",
"Stars": "Stars", "Stars": "Stars",
@@ -88,7 +88,7 @@
"Copy_Title": "Copy Title", "Copy_Title": "Copy Title",
"Copy_Link": "Copy Link", "Copy_Link": "Copy Link",
"Open_in_a_New_Tab": "Open in a New Tab", "Open_in_a_New_Tab": "Open in a New Tab",
"Open_with_Stealth_Mode": "Open with Stealth Mode", "Open_with_Incognito_Mode": "Open with Incognito Mode",
"Open_backgroundly": "Open backgroundly", "Open_backgroundly": "Open backgroundly",
"Open_image_in_a_New_Tab": "Open image in a new tab", "Open_image_in_a_New_Tab": "Open image in a new tab",
"Download_image": "Download image" "Download_image": "Download image"

View File

@@ -2,7 +2,7 @@
"Back": "后退", "Back": "后退",
"Forward": "前进", "Forward": "前进",
"Refresh": "刷新", "Refresh": "刷新",
"Stealth": "隐身", "Incognito": "无痕",
"Comming_soon": "很快到达...", "Comming_soon": "很快到达...",
"Bookmarks": "书签", "Bookmarks": "书签",
"Stars": "保存书签", "Stars": "保存书签",
@@ -84,5 +84,12 @@
"About_Me": "关于我", "About_Me": "关于我",
"Privacy": "隐私", "Privacy": "隐私",
"Custom": "自定义", "Custom": "自定义",
"Input_search_url_des": "请输入搜索链接" "Input_search_url_des": "请输入搜索链接",
"Copy_Title": "复制标题",
"Copy_Link": "复制链接",
"Open_in_a_New_Tab": "打开新标签",
"Open_with_Incognito_Mode": "无痕模式打开",
"Open_backgroundly": "后台打开",
"Open_image_in_a_New_Tab": "新标签打开图片",
"Download_image": "下载图片"
} }

View File

@@ -79,9 +79,23 @@ class WebProvider extends ChangeNotifier {
} }
} }
void setIcognitoMode({bool? incognito}) {
var webInfo = currentWebInfo();
if (webInfo != null) {
if (incognito != null) {
webInfo.incognitoMode = incognito;
} else {
webInfo.incognitoMode = !(webInfo.incognitoMode);
}
updateWebInfo(webInfo);
}
}
void addTab({ void addTab({
String url = "", String url = "",
bool openTab = true, bool openTab = true,
bool incognito = false,
}) { }) {
if (StringUtil.isNotBlank(url)) { if (StringUtil.isNotBlank(url)) {
var _currentWebInfo = currentWebInfo(); var _currentWebInfo = currentWebInfo();
@@ -92,7 +106,8 @@ class WebProvider extends ChangeNotifier {
} }
} }
webInfos.add(WebInfo(_rndId(), url)); var webInfo = WebInfo(_rndId(), url, incognitoMode: incognito);
webInfos.add(webInfo);
if (openTab) { if (openTab) {
index = webInfos.length - 1; index = webInfos.length - 1;
} }
@@ -196,7 +211,9 @@ class WebProvider extends ChangeNotifier {
} }
webInfo.browserHistory = browserHistory; webInfo.browserHistory = browserHistory;
BrowserHistoryDB.insert(browserHistory); if (!webInfo.incognitoMode) {
BrowserHistoryDB.insert(browserHistory);
}
updateWebInfo(webInfo, updateUI: false); updateWebInfo(webInfo, updateUI: false);
} catch (e) {} } catch (e) {}

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:nostr_sdk/utils/string_util.dart'; import 'package:nostr_sdk/utils/string_util.dart';
import 'package:nowser/component/webview/web_info.dart'; import 'package:nowser/component/webview/web_info.dart';
import 'package:nowser/provider/web_provider.dart'; import 'package:nowser/provider/web_provider.dart';
@@ -28,12 +29,23 @@ class _IndexWebBottomComponent extends State<IndexWebBottomComponent> {
var padding = mediaQuery.padding; var padding = mediaQuery.padding;
var maxWidth = mediaQuery.size.width; var maxWidth = mediaQuery.size.width;
var titleWidth = maxWidth / 2; var titleWidth = maxWidth / 2;
var themeData = Theme.of(context);
var mediumFontSize = themeData.textTheme.bodyMedium?.fontSize;
return Selector<WebProvider, WebInfo?>(builder: (context, webInfo, child) { return Selector<WebProvider, WebInfo?>(builder: (context, webInfo, child) {
if (webInfo == null || StringUtil.isBlank(webInfo.url)) { if (webInfo == null || StringUtil.isBlank(webInfo.url)) {
return Container(); return Container();
} }
var webStatusIcon =
Icon(Icons.lock, color: Colors.green, size: mediumFontSize);
if (webInfo.incognitoMode) {
webStatusIcon =
Icon(MaterialCommunityIcons.incognito, size: mediumFontSize);
} else if (!webInfo.isSecure) {
webStatusIcon = Icon(Icons.lock_open, size: mediumFontSize);
}
String title = ""; String title = "";
if (StringUtil.isNotBlank(webInfo.title)) { if (StringUtil.isNotBlank(webInfo.title)) {
title = webInfo.title!; title = webInfo.title!;
@@ -92,10 +104,21 @@ class _IndexWebBottomComponent extends State<IndexWebBottomComponent> {
bottom: Base.BASE_PADDING_HALF, bottom: Base.BASE_PADDING_HALF,
), ),
width: titleWidth, width: titleWidth,
child: Text( child: Row(
title, children: [
maxLines: 1, Container(
overflow: TextOverflow.ellipsis, margin: const EdgeInsets.only(
right: Base.BASE_PADDING_HALF),
child: webStatusIcon,
),
Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
), ),
), ),
), ),

View File

@@ -61,53 +61,61 @@ class _IndexWebComponent extends State<IndexWebComponent> {
Widget? webComp; Widget? webComp;
if (!Platform.isLinux) { if (!Platform.isLinux) {
webComp = WebViewComponent( webComp = WebViewComponent(
webInfo, webInfo,
(webInfo, controller) { (webInfo, controller) {
webInfo.controller = WebviewController(controller); webInfo.controller = WebviewController(controller);
webProvider.updateWebInfo(webInfo);
},
onTitleChanged,
(webInfo, controller) {
webInfo.controller = WebviewController(controller);
webProvider.onLoadStop(webInfo);
});
} else {
webComp = WebViewLinuxComponent(
webInfo,
(webInfo, controller) {
webInfo.controller = WebviewLinuxController(controller);
webProvider.updateWebInfo(webInfo);
},
(webInfo, controller, title) {
if (webInfo.controller is WebviewLinuxController && StringUtil.isNotBlank(title)) {
(webInfo.controller as WebviewLinuxController).setTitle(title!);
webInfo.title = title;
webProvider.updateWebInfo(webInfo); webProvider.updateWebInfo(webInfo);
} },
}, onTitleChanged,
(webInfo, controller, url) { (webInfo, controller, url) {
if (webInfo.controller is WebviewLinuxController && StringUtil.isNotBlank(url)) { var urlStr = url.toString();
print("url change! $url"); if (urlStr.startsWith("https")) {
(webInfo.controller as WebviewLinuxController).setUrl(url!); webInfo.isSecure = true;
webInfo.url = url; } else {
} webInfo.isSecure = false;
}, }
(webInfo, controller) async { },
webInfo.controller ??= WebviewLinuxController(controller); (webInfo, controller) {
var title = await webInfo.controller!.getTitle(); webInfo.controller = WebviewController(controller);
webProvider.onLoadStop(webInfo);
});
} else {
webComp = WebViewLinuxComponent(webInfo, (webInfo, controller) {
webInfo.controller = WebviewLinuxController(controller);
webProvider.updateWebInfo(webInfo);
}, (webInfo, controller, title) {
if (webInfo.controller is WebviewLinuxController &&
StringUtil.isNotBlank(title)) {
(webInfo.controller as WebviewLinuxController).setTitle(title!);
webInfo.title = title; webInfo.title = title;
webProvider.onLoadStop(webInfo); webProvider.updateWebInfo(webInfo);
}); }
} }, (webInfo, controller, url) {
if (webInfo.controller is WebviewLinuxController &&
StringUtil.isNotBlank(url)) {
if (url!.startsWith("https")) {
webInfo.isSecure = true;
} else {
webInfo.isSecure = false;
}
var main = webComp; print("url change! $url");
(webInfo.controller as WebviewLinuxController).setUrl(url!);
webInfo.url = url;
}
}, (webInfo, controller) async {
webInfo.controller ??= WebviewLinuxController(controller);
var title = await webInfo.controller!.getTitle();
webInfo.title = title;
webProvider.onLoadStop(webInfo);
});
}
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: padding.top, top: padding.top,
), ),
child: main, child: webComp,
); );
} }

View File

@@ -26,7 +26,9 @@ class _WebControlComponent extends State<WebControlComponent> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var s = S.of(context); var s = S.of(context);
var webProvider = Provider.of<WebProvider>(context); var webProvider = Provider.of<WebProvider>(context);
var webInfo = webProvider.currentWebInfo; var webInfo = webProvider.currentWebInfo();
var themeData = Theme.of(context);
Color mainColor = themeData.colorScheme.primary;
return Container( return Container(
child: Column( child: Column(
@@ -78,13 +80,15 @@ class _WebControlComponent extends State<WebControlComponent> {
), ),
Expanded( Expanded(
child: WebControlBtnComponent( child: WebControlBtnComponent(
name: s.Stealth, name: s.Incognito,
icon: const Icon( icon: Icon(
Icons.disabled_visible_outlined, Icons.disabled_visible_outlined,
size: 30, size: 30,
color: webInfo?.incognitoMode == true ? mainColor : null,
), ),
onTap: () { onTap: () {
BotToast.showText(text: s.Comming_soon); webProvider.setIcognitoMode();
widget.closeControl();
}, },
), ),
), ),

View File

@@ -279,6 +279,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.4.1" version: "3.4.1"
flutter_font_icons:
dependency: "direct main"
description:
name: flutter_font_icons
sha256: d06eb0ab903d0e90a9a758de30892ea0d43221f03dad059970384e62479c787e
url: "https://pub.dev"
source: hosted
version: "2.2.7"
flutter_font_picker: flutter_font_picker:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@@ -59,6 +59,7 @@ dependencies:
# searchfield: 1.2.0 # searchfield: 1.2.0
searchfield: ^1.2.7 searchfield: ^1.2.7
webview_cef: ^0.2.2 webview_cef: ^0.2.2
flutter_font_icons: ^2.2.7
dev_dependencies: dev_dependencies:
flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: ^0.13.1