opt: override note title

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-02 22:15:23 +08:00
parent d409424871
commit 2d0e801a1a

View File

@@ -282,11 +282,12 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
: null, : null,
shouldInterceptAjaxRequest: (controller, ajaxRequest) async { shouldInterceptAjaxRequest: (controller, ajaxRequest) async {
String url = ajaxRequest.url.toString(); String url = ajaxRequest.url.toString();
if (url.startsWith('//api.bilibili.com/x/note/add')) { if (url.startsWith('//api.bilibili.com/x/note/add') &&
widget.title != null) {
return ajaxRequest return ajaxRequest
..data = ajaxRequest.data ..data = ajaxRequest.data
.toString() .toString()
.replaceFirst('title=--', 'title=${widget.title}'); .replaceFirst('&title=--&', '&title=${widget.title}&');
} }
return null; return null;
}, },