mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-07-04 20:02:34 +08:00
🔧 customize HTTP user-agent for fetching subscription from API.
This commit is contained in:
@ -75,6 +75,12 @@
|
||||
<label for="proxy">节点分享链接:</label>
|
||||
<textarea class="form-control" id="proxy" name="proxy" placeholder="每行输入一个节点分享链接" rows="5"></textarea>
|
||||
</div>
|
||||
<!-- User Agent -->
|
||||
<div class="form-group mb-3">
|
||||
<label for="user-agent">ua标识:</label>
|
||||
<textarea class="form-control" id="user-agent" name="user-agent"
|
||||
placeholder="用于获取订阅的http请求中的user-agent标识(可选)" rows="1"></textarea>
|
||||
</div>
|
||||
<!-- Refresh -->
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" id="refresh" name="refresh" type="checkbox" />
|
||||
@ -172,4 +178,5 @@
|
||||
</div>
|
||||
</body>
|
||||
<script src="./static/index.js"></script>
|
||||
|
||||
</html>
|
@ -66,6 +66,11 @@ function generateURI() {
|
||||
// alert("订阅链接和节点分享链接不能同时为空!");
|
||||
return "";
|
||||
}
|
||||
|
||||
// 获取订阅user-agent标识
|
||||
const userAgent = document.getElementById("user-agent").value;
|
||||
queryParams.push(`userAgent=${userAgent}`)
|
||||
|
||||
// 获取复选框的值
|
||||
const refresh = document.getElementById("refresh").checked;
|
||||
queryParams.push(`refresh=${refresh ? "true" : "false"}`);
|
||||
|
Reference in New Issue
Block a user