fix: automate graduate timetable read and refine blue glass Dock
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart';
|
||||
|
||||
@@ -25,6 +26,7 @@ class FakeSchoolWeb extends PlatformWebViewController {
|
||||
final loads = <String>[];
|
||||
String? url;
|
||||
Future<Object> Function(String)? javascript;
|
||||
Future<void> Function(Uri)? request;
|
||||
@override
|
||||
Future<void> setJavaScriptMode(JavaScriptMode mode) async {}
|
||||
@override
|
||||
@@ -35,6 +37,7 @@ class FakeSchoolWeb extends PlatformWebViewController {
|
||||
Future<void> loadRequest(LoadRequestParams params) async {
|
||||
url = params.uri.toString();
|
||||
loads.add(url!);
|
||||
await request?.call(params.uri);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -100,3 +103,18 @@ Future<void> flushSchoolEvents() async {
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
}
|
||||
}
|
||||
|
||||
String schoolPageEvidence({
|
||||
required String topUrl,
|
||||
bool authenticated = false,
|
||||
String? html,
|
||||
String? documentUrl,
|
||||
String kind = 'timetable',
|
||||
}) => jsonEncode({
|
||||
'topUrl': topUrl,
|
||||
'authenticated': authenticated,
|
||||
'pages': [
|
||||
if (html != null)
|
||||
{'kind': kind, 'url': documentUrl ?? topUrl, 'html': html},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user