mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
opt: webview: add note
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -190,20 +190,6 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
|
|||||||
handlerName: 'finishButtonClicked',
|
handlerName: 'finishButtonClicked',
|
||||||
callback: (args) {
|
callback: (args) {
|
||||||
Get.back();
|
Get.back();
|
||||||
// _webViewController?.evaluateJavascript(source: """
|
|
||||||
// Array.from(document.querySelectorAll('.ql-editor > p')).map(p => p.textContent).join('\\n');
|
|
||||||
// """).then((value) {
|
|
||||||
// try {
|
|
||||||
// String? summary = (value as String?);
|
|
||||||
// if (summary?.isNotEmpty == true) {
|
|
||||||
// VideoHttp.addNote(
|
|
||||||
// oid: widget.oid!,
|
|
||||||
// title: widget.title!,
|
|
||||||
// summary: summary!,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// } catch (_) {}
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
_webViewController?.addJavaScriptHandler(
|
_webViewController?.addJavaScriptHandler(
|
||||||
@@ -294,6 +280,16 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
|
|||||||
_progressStream.add(1);
|
_progressStream.add(1);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
shouldInterceptAjaxRequest: (controller, ajaxRequest) async {
|
||||||
|
String url = ajaxRequest.url.toString();
|
||||||
|
if (url.startsWith('//api.bilibili.com/x/note/add')) {
|
||||||
|
return ajaxRequest
|
||||||
|
..data = ajaxRequest.data
|
||||||
|
.toString()
|
||||||
|
.replaceFirst('title=--', 'title=${widget.title}');
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
shouldInterceptRequest: (controller, request) async {
|
shouldInterceptRequest: (controller, request) async {
|
||||||
String url = request.url.toString();
|
String url = request.url.toString();
|
||||||
if (url.startsWith(
|
if (url.startsWith(
|
||||||
|
|||||||
Reference in New Issue
Block a user