mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: web down
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
import 'package:PiliPlus/http/init.dart';
|
import 'package:PiliPlus/http/init.dart';
|
||||||
@@ -196,16 +197,18 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
|
|||||||
// ''',
|
// ''',
|
||||||
// );
|
// );
|
||||||
},
|
},
|
||||||
onDownloadStartRequest: (controller, request) {
|
onDownloadStartRequest: Platform.isAndroid
|
||||||
|
? (controller, request) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
String suggestedFilename =
|
String suggestedFilename =
|
||||||
request.suggestedFilename.toString();
|
request.suggestedFilename.toString();
|
||||||
String fileSize =
|
String fileSize = CacheManage.formatSize(
|
||||||
CacheManage.formatSize(request.contentLength.toDouble());
|
request.contentLength.toDouble());
|
||||||
try {
|
try {
|
||||||
suggestedFilename = Uri.decodeComponent(suggestedFilename);
|
suggestedFilename =
|
||||||
|
Uri.decodeComponent(suggestedFilename);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint(e.toString());
|
debugPrint(e.toString());
|
||||||
}
|
}
|
||||||
@@ -230,7 +233,8 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
_progressStream.add(1);
|
_progressStream.add(1);
|
||||||
},
|
}
|
||||||
|
: null,
|
||||||
shouldOverrideUrlLoading: (controller, navigationAction) async {
|
shouldOverrideUrlLoading: (controller, navigationAction) async {
|
||||||
final String? str =
|
final String? str =
|
||||||
navigationAction.request.url!.pathSegments.getOrNull(0);
|
navigationAction.request.url!.pathSegments.getOrNull(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user