mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-27 10:15:50 +08:00
Merge branch 'main' into d-v3
# Conflicts: # BetterGenshinImpact/ViewModel/Pages/ScriptControlViewModel.cs
This commit is contained in:
@@ -106,6 +106,22 @@ public partial class ScriptGroupProject : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool? _allowJsNotification = true;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _allowJsHTTPHash = "";
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许JS脚本发送HTTP请求,通过验证Hash来控制
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool AllowJsHTTP
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetHttpAllowedUrlsHash() == AllowJsHTTPHash;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ScriptGroupProject()
|
||||
{
|
||||
}
|
||||
@@ -163,6 +179,19 @@ public partial class ScriptGroupProject : ObservableObject
|
||||
Project = new ScriptProject(FolderName);
|
||||
}
|
||||
|
||||
public string GetHttpAllowedUrlsHash()
|
||||
{
|
||||
if (Project == null)
|
||||
{
|
||||
BuildScriptProjectRelation();
|
||||
}
|
||||
if (Project == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return string.Join("|", Project.Manifest.HttpAllowedUrls);
|
||||
}
|
||||
|
||||
public async Task Run()
|
||||
{
|
||||
//执行记录
|
||||
|
||||
Reference in New Issue
Block a user