mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: override note title
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user