mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
Compare commits
4 commits
18b9609a23
...
6f832ad3d9
Author | SHA1 | Date | |
---|---|---|---|
|
6f832ad3d9 | ||
|
8ea7d1e5a9 | ||
|
577cf5c6f6 | ||
|
a81920a1a5 |
11 changed files with 140 additions and 138 deletions
|
@ -12,8 +12,9 @@
|
|||
<pubDate>Tue, 11 Apr 2023 00:00:00 +0000</pubDate>
|
||||
|
||||
<guid>/en/redirect/</guid>
|
||||
<description>Redirection forwards cookies with all following three setting options enabled: &quot;Resource redirection&quot;, &quot;Redirect w/ cookies&quot; and &quot;Hide certificate errors&quot;, so use the options with care.
|
||||
Global redirection Global redirection is enabled with the setting option &quot;Resource redirection&quot;.
|
||||
<description>⚠️Redirection forwards cookies with the setting option &quot;Redirect cookies&quot; enabled, so use the options with care.
|
||||
Setting options: &quot;Url redirection&quot; vs. &quot;Resource redirection&quot; &quot;Url redirection&quot; redirects the main/page url only while &quot;Resource redirection&quot; is for all urls in the page.
|
||||
Global redirection Global redirection is enabled with the setting option &quot;Resource redirection&quot; or both &quot;Url redirection&quot; and &quot;Redirect cookies&quot;.
|
||||
When a valid global redirection url is set, the &quot;default.redirect&quot; has no effect, and any url resource is fetched with the new url by appending the original url to the global redirection url.</description>
|
||||
</item>
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<p><a href="https://github.com/torappinfo/uweb/releases/tag/v1">github</a></p>
|
||||
<p><a href="https://sourceforge.net/projects/uwebbrowser/files/v1/">sourceforge</a></p>
|
||||
<p><a href="https://my.powerfolder.com/getlink/fi61cC6VHjK72tfufmnLAz/">powerfolder</a></p>
|
||||
<p><a href="https://u.pcloud.link/publink/show?code=kZXFGdVZ4tBRn1r2yn8yjJUGmT0ecQlRu4e7">pcloud</a></p>
|
||||
<p><a href="https://releases.pagure.org/uweb/">pagure</a></p>
|
||||
<h4 id="main-featuresreadmeindexhtml"><a href="../readme/index.html">Main features</a></h4>
|
||||
<h4 id="change-logs">Change logs</h4>
|
||||
|
@ -77,8 +78,8 @@
|
|||
</ul>
|
||||
|
||||
</div>
|
||||
<p>Last Modified: 14 April 2023<br>
|
||||
add option: 'cookie forward'<br>
|
||||
<p>Last Modified: 15 April 2023<br>
|
||||
enhance redirection cookie support<br>
|
||||
<pre></pre>
|
||||
</p>
|
||||
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
<pubDate>Tue, 11 Apr 2023 00:00:00 +0000</pubDate>
|
||||
|
||||
<guid>/en/redirect/</guid>
|
||||
<description>Redirection forwards cookies with all following three setting options enabled: &quot;Resource redirection&quot;, &quot;Redirect w/ cookies&quot; and &quot;Hide certificate errors&quot;, so use the options with care.
|
||||
Global redirection Global redirection is enabled with the setting option &quot;Resource redirection&quot;.
|
||||
<description>⚠️Redirection forwards cookies with the setting option &quot;Redirect cookies&quot; enabled, so use the options with care.
|
||||
Setting options: &quot;Url redirection&quot; vs. &quot;Resource redirection&quot; &quot;Url redirection&quot; redirects the main/page url only while &quot;Resource redirection&quot; is for all urls in the page.
|
||||
Global redirection Global redirection is enabled with the setting option &quot;Resource redirection&quot; or both &quot;Url redirection&quot; and &quot;Redirect cookies&quot;.
|
||||
When a valid global redirection url is set, the &quot;default.redirect&quot; has no effect, and any url resource is fetched with the new url by appending the original url to the global redirection url.</description>
|
||||
</item>
|
||||
|
||||
|
@ -205,13 +206,13 @@ uweb, termux &amp; history versions
|
|||
github
|
||||
sourceforge
|
||||
powerfolder
|
||||
pcloud
|
||||
pagure
|
||||
Main features Change logs 991: global url redirection support.
|
||||
988: hosts file to support response headers.
|
||||
985: Special urls to support shortcut keys such as ctrl-a to ctrl-z.
|
||||
983: support &quot;hosts&quot; file domain name resolving (no root needed), only single space allowed as separator for ip address and domain name.
|
||||
975: Bookmarks to support styling for markdown etc.
|
||||
971: multiple type profiles: switch any data including website logins, user configurations orthogonally.</description>
|
||||
975: Bookmarks to support styling for markdown etc.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
|
|
@ -49,9 +49,11 @@
|
|||
<li><a href="../tags/redirection">redirection</a> </li>
|
||||
|
||||
</ul>
|
||||
<p><span style="color:red">Redirection forwards cookies</span> with all following three setting options enabled: "Resource redirection", "Redirect w/ cookies" and "Hide certificate errors", so use the options with care.</p>
|
||||
<p>⚠️<span style="color:red">Redirection forwards cookies</span> with the setting option "Redirect cookies" enabled, so use the options with care.</p>
|
||||
<h4 id="setting-options-url-redirection-vs-resource-redirection">Setting options: "Url redirection" vs. "Resource redirection"</h4>
|
||||
<p>"Url redirection" redirects the main/page url only while "Resource redirection" is for all urls in the page.</p>
|
||||
<h4 id="global-redirection">Global redirection</h4>
|
||||
<p><a href="i:60/data/data/info.torapp.uweb/files/config.html:https://jamesfengcao.codeberg.page/en/searchurl/config.html">Global redirection</a> is enabled with the setting option "Resource redirection".</p>
|
||||
<p><a href="i:60/data/data/info.torapp.uweb/files/config.html:https://jamesfengcao.codeberg.page/en/searchurl/config.html">Global redirection</a> is enabled with the setting option "Resource redirection" or both "Url redirection" and "Redirect cookies".</p>
|
||||
<p>When a valid global redirection url is set, the "default.redirect" has no effect, and any url resource is fetched with the new url by appending the original url to the global redirection url.</p>
|
||||
<h4 id="defaultredirect-valid-only-without-global-redirection-url">"default.redirect" (valid only without global redirection url)</h4>
|
||||
<p>Click the following links to append mirrors to the file "default.redirect":<br>
|
||||
|
@ -67,8 +69,8 @@
|
|||
</ul>
|
||||
|
||||
</div>
|
||||
<p>Last Modified: 14 April 2023<br>
|
||||
add option: 'cookie forward'<br>
|
||||
<p>Last Modified: 15 April 2023<br>
|
||||
enhance redirection cookie support<br>
|
||||
<pre></pre>
|
||||
</p>
|
||||
|
||||
|
|
|
@ -79,6 +79,8 @@
|
|||
if(v && v.startsWith("http")) return v;
|
||||
return "https://mybing2.xn--xyza.top/";
|
||||
}
|
||||
function getStartProposes(){return ["","",""];}
|
||||
function getStartMessage(){return "";}
|
||||
</script>
|
||||
<script type="text/javascript" src="./js/GetSet.js"></script>
|
||||
<script type="text/javascript" src="./js/optionsSets.js"></script>
|
||||
|
|
|
@ -1,30 +1,12 @@
|
|||
var expUrl = new RegExp('^(https?://)([-a-zA-z0-9]+\\.)+([-a-zA-z0-9]+)+\\S*$');
|
||||
function timeString() {
|
||||
var d = new Date();
|
||||
var year = d.getFullYear();
|
||||
var month = (d.getMonth() + 1).toString().padStart(2, "0");
|
||||
var date = d.getDate().toString().padStart(2, "0");
|
||||
var hour = d.getHours().toString().padStart(2, "0");
|
||||
var minute = d.getMinutes().toString().padStart(2, "0");
|
||||
var second = d.getSeconds().toString().padStart(2, "0");
|
||||
var offset = "+08:00"; // 你可以根据需要修改这个值
|
||||
var s = year + "-" + month + "-" + date + "T" + hour + ":" + minute + ":" + second + offset;
|
||||
return s;
|
||||
}
|
||||
|
||||
function getUuidNojian() {
|
||||
return URL.createObjectURL(new Blob()).split('/')[3].replace(/-/g, '');
|
||||
}
|
||||
|
||||
function getUuid() {
|
||||
return URL.createObjectURL(new Blob()).split('/')[3];
|
||||
}
|
||||
|
||||
class SendMessageManager {
|
||||
//(会话id,客户端id,签名id,是否是开始)
|
||||
//(string,string,string,boolena)
|
||||
constructor(conversationId, clientId, conversationSignature,invocationId) {
|
||||
this.startTime = timeString();
|
||||
this.invocationId = invocationId==undefined?1:invocationId;
|
||||
this.conversationId = conversationId;
|
||||
this.clientId = clientId;
|
||||
|
@ -53,86 +35,24 @@ class SendMessageManager {
|
|||
}
|
||||
//获取用于发送的聊天数据
|
||||
//(WebSocket,sreing)
|
||||
sendChatMessage(chatWebSocket, chat) {
|
||||
let pos = ['','','']; //initial 3 suggestions
|
||||
let previousMessages = [{
|
||||
"text": '',
|
||||
"author": "bot",
|
||||
"adaptiveCards": [],
|
||||
"suggestedResponses": [{
|
||||
"text": pos[0],
|
||||
"contentOrigin": "DeepLeo",
|
||||
"messageType": "Suggestion",
|
||||
"messageId": getUuid(),
|
||||
"offense": "Unknown"
|
||||
}, {
|
||||
"text": pos[1],
|
||||
"contentOrigin": "DeepLeo",
|
||||
"messageType": "Suggestion",
|
||||
"messageId": getUuid(),
|
||||
"offense": "Unknown"
|
||||
}, {
|
||||
"text": pos[2],
|
||||
"contentOrigin": "DeepLeo",
|
||||
"messageType": "Suggestion",
|
||||
"messageId": getUuid(),
|
||||
"offense": "Unknown"
|
||||
}],
|
||||
"messageId": getUuid(),
|
||||
"messageType": "Chat"
|
||||
}];
|
||||
async sendChatMessage(chatWebSocket, chat) {
|
||||
let optionsSets = chatTypes[this.optionsSets];
|
||||
let json = {
|
||||
"arguments": [{
|
||||
"source": "cib",
|
||||
"optionsSets": this.optionsSets,
|
||||
"source": source,
|
||||
"optionsSets": optionsSets,
|
||||
"allowedMessageTypes": allowedMessageTypes,
|
||||
"sliceIds": sliceIds,
|
||||
"verbosity": "verbose",
|
||||
"traceId": getUuidNojian(),
|
||||
"isStartOfSession": (this.invocationId <= 1) ? true : false,
|
||||
"message": {
|
||||
"locale": "zh-CN",
|
||||
"market": "zh-CN",
|
||||
"region": "US",
|
||||
"location": "lat:47.639557;long:-122.128159;re=1000m;",
|
||||
"locationHints": [
|
||||
{
|
||||
"Center": {
|
||||
"Latitude": 30.474109798833613,
|
||||
"Longitude": 114.39626256171093
|
||||
},
|
||||
"RegionType": 2,
|
||||
"SourceType": 11
|
||||
},
|
||||
{
|
||||
"country": "United States",
|
||||
"state": "California",
|
||||
"city": "Los Angeles",
|
||||
"zipcode": "90060",
|
||||
"timezoneoffset": -8,
|
||||
"dma": 803,
|
||||
"countryConfidence": 8,
|
||||
"cityConfidence": 5,
|
||||
"Center": {
|
||||
"Latitude": 33.9757,
|
||||
"Longitude": -118.2564
|
||||
},
|
||||
"RegionType": 2,
|
||||
"SourceType": 1
|
||||
}
|
||||
],
|
||||
"timestamp": this.startTime,
|
||||
"author": "user",
|
||||
"inputMethod": "Keyboard",
|
||||
"text": chat,
|
||||
"messageType": "Chat"
|
||||
},
|
||||
"message": await generateMessages(this,chat),
|
||||
"conversationSignature": this.conversationSignature,
|
||||
"participant": {
|
||||
"id": this.clientId
|
||||
},
|
||||
"conversationId": this.conversationId,
|
||||
"previousMessages": (this.invocationId <= 1) ? previousMessages : undefined
|
||||
"previousMessages": (this.invocationId <= 1) ? await getPreviousMessages() : undefined
|
||||
}],
|
||||
"invocationId": this.invocationId.toString(),
|
||||
"target": "chat",
|
||||
|
@ -140,7 +60,6 @@ class SendMessageManager {
|
|||
};
|
||||
this.sendJson(chatWebSocket, json);
|
||||
this.invocationId++;
|
||||
setLastInvocationId(this.invocationId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,10 +8,11 @@ let chatTypes = {
|
|||
"responsible_ai_policy_235",
|
||||
"enablemm",
|
||||
"h3imaginative",
|
||||
"jbf101",
|
||||
"responseos",
|
||||
"cachewriteext",
|
||||
"e2ecachewrite",
|
||||
"nodlcpcwrite",
|
||||
"travelansgnd",
|
||||
"dv3sugg",
|
||||
"clgalileo",
|
||||
"gencontentv3"
|
||||
|
@ -24,31 +25,39 @@ let chatTypes = {
|
|||
"responsible_ai_policy_235",
|
||||
"enablemm",
|
||||
"galileo",
|
||||
"jbf101",
|
||||
"responseos",
|
||||
"cachewriteext",
|
||||
"e2ecachewrite",
|
||||
"nodlcpcwrite",
|
||||
"dv3sugg",
|
||||
"dlwebtrunc",
|
||||
"glpromptv6"
|
||||
"travelansgnd",
|
||||
"dv3sugg"
|
||||
],
|
||||
//精准选项
|
||||
accurate: [
|
||||
"nlu_direct_response_filter",
|
||||
"deepleo",
|
||||
"disable_emoji_spoken_text",
|
||||
"responsible_ai_policy_235",
|
||||
"enablemm",
|
||||
"h3precise",
|
||||
"clgalileo",
|
||||
"jbf101",
|
||||
"cachewriteext",
|
||||
"e2ecachewrite",
|
||||
"nodlcpcwrite",
|
||||
"dv3sugg"
|
||||
"chk1cf",
|
||||
"nopreloadsscf",
|
||||
"winlongmsg2tf",
|
||||
"perfimpcomb",
|
||||
"sugdivdis",
|
||||
"sydnoinputt",
|
||||
"wpcssopt",
|
||||
"wintone2tf",
|
||||
"0404sydicnbs0",
|
||||
"405suggbs0",
|
||||
"scctl",
|
||||
"330uaugs0",
|
||||
"0329resp",
|
||||
"udscahrfon",
|
||||
"udstrblm5",
|
||||
"404e2ewrt",
|
||||
"408nodedups0",
|
||||
"403tvlansgnd"
|
||||
]
|
||||
}
|
||||
|
||||
//消息来源
|
||||
let source = "cib";
|
||||
|
||||
//接收消息类型
|
||||
let allowedMessageTypes = [
|
||||
"Chat",
|
||||
|
@ -65,21 +74,87 @@ let allowedMessageTypes = [
|
|||
|
||||
//切片id,也不知道是啥意思,反正官网的更新了
|
||||
let sliceIds = [
|
||||
"audseq",
|
||||
"chk1cln",
|
||||
"nofbkcf",
|
||||
"nosharepre",
|
||||
"fixsacodecf",
|
||||
"chk1cf",
|
||||
"nopreloadsscf",
|
||||
"winlongmsg2tf",
|
||||
"perfimpcomb",
|
||||
"sugdivdis",
|
||||
"sydnoinputt",
|
||||
"wpcssopt",
|
||||
"wintone2tf",
|
||||
"0404sydicnbs0",
|
||||
"405suggbs0",
|
||||
"scctl",
|
||||
"403jbf101",
|
||||
"udstrclm8cmp",
|
||||
"udstrclm8",
|
||||
"329v6webtrunc",
|
||||
"404e2ewrt"
|
||||
"330uaugs0",
|
||||
"0329resp",
|
||||
"udscahrfon",
|
||||
"udstrblm5",
|
||||
"404e2ewrt",
|
||||
"408nodedups0",
|
||||
"403tvlansgnd"
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
//生成消息对象
|
||||
async function generateMessages(sendMessageManager/*消息管理器*/,chatMessageText/*要发送的消息文本*/){
|
||||
function timeString() {
|
||||
var d = new Date();
|
||||
var year = d.getFullYear();
|
||||
var month = (d.getMonth() + 1).toString().padStart(2, "0");
|
||||
var date = d.getDate().toString().padStart(2, "0");
|
||||
var hour = d.getHours().toString().padStart(2, "0");
|
||||
var minute = d.getMinutes().toString().padStart(2, "0");
|
||||
var second = d.getSeconds().toString().padStart(2, "0");
|
||||
var offset = "+08:00"; // 你可以根据需要修改这个值
|
||||
var s = year + "-" + month + "-" + date + "T" + hour + ":" + minute + ":" + second + offset;
|
||||
return s;
|
||||
}
|
||||
|
||||
if(!sendMessageManager.startTime){
|
||||
sendMessageManager.startTime = timeString();
|
||||
}
|
||||
return {
|
||||
"locale": "zh-CN",
|
||||
"market": "zh-CN",
|
||||
"region": "US",
|
||||
"location": "lat:47.639557;long:-122.128159;re=1000m;",
|
||||
"locationHints": [
|
||||
{
|
||||
"Center": {
|
||||
"Latitude": 30.474109798833613,
|
||||
"Longitude": 114.39626256171093
|
||||
},
|
||||
"RegionType": 2,
|
||||
"SourceType": 11
|
||||
},
|
||||
{
|
||||
"country": "United States",
|
||||
"state": "California",
|
||||
"city": "Los Angeles",
|
||||
"zipcode": "90060",
|
||||
"timezoneoffset": -8,
|
||||
"dma": 803,
|
||||
"countryConfidence": 8,
|
||||
"cityConfidence": 5,
|
||||
"Center": {
|
||||
"Latitude": 33.9757,
|
||||
"Longitude": -118.2564
|
||||
},
|
||||
"RegionType": 2,
|
||||
"SourceType": 1
|
||||
}
|
||||
],
|
||||
"timestamp": sendMessageManager.startTime,
|
||||
"author": "user",
|
||||
"inputMethod": "Keyboard",
|
||||
"text": chatMessageText,
|
||||
"messageType": "Chat"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function getPreviousMessages(){
|
||||
function getUuid() {
|
||||
return URL.createObjectURL(new Blob()).split('/')[3];
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
<url>
|
||||
<loc>/en/_posts/</loc>
|
||||
<lastmod>2023-04-14T16:04:50+08:00</lastmod>
|
||||
<lastmod>2023-04-15T18:08:03+08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
|
@ -16,10 +16,10 @@
|
|||
/>
|
||||
</url><url>
|
||||
<loc>/en/tags/redirection/</loc>
|
||||
<lastmod>2023-04-14T16:04:50+08:00</lastmod>
|
||||
<lastmod>2023-04-15T18:08:03+08:00</lastmod>
|
||||
</url><url>
|
||||
<loc>/en/redirect/</loc>
|
||||
<lastmod>2023-04-14T16:04:50+08:00</lastmod>
|
||||
<lastmod>2023-04-15T18:08:03+08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
|
@ -32,7 +32,7 @@
|
|||
/>
|
||||
</url><url>
|
||||
<loc>/en/tags/</loc>
|
||||
<lastmod>2023-04-14T16:04:50+08:00</lastmod>
|
||||
<lastmod>2023-04-15T18:08:03+08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
|
@ -45,7 +45,7 @@
|
|||
/>
|
||||
</url><url>
|
||||
<loc>/en/</loc>
|
||||
<lastmod>2023-04-14T16:04:50+08:00</lastmod>
|
||||
<lastmod>2023-04-15T18:08:03+08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
|
@ -113,7 +113,7 @@
|
|||
/>
|
||||
</url><url>
|
||||
<loc>/en/topposts/</loc>
|
||||
<lastmod>2023-04-14T10:37:49+08:00</lastmod>
|
||||
<lastmod>2023-04-15T14:17:21+08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
|
@ -210,7 +210,7 @@
|
|||
/>
|
||||
</url><url>
|
||||
<loc>/en/changelog/</loc>
|
||||
<lastmod>2023-04-14T10:37:49+08:00</lastmod>
|
||||
<lastmod>2023-04-15T14:17:21+08:00</lastmod>
|
||||
</url><url>
|
||||
<loc>/en/sitemap/</loc>
|
||||
<lastmod>2023-02-01T09:52:11+08:00</lastmod>
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
<pubDate>Tue, 11 Apr 2023 00:00:00 +0000</pubDate>
|
||||
|
||||
<guid>/en/redirect/</guid>
|
||||
<description>Redirection forwards cookies with all following three setting options enabled: &quot;Resource redirection&quot;, &quot;Redirect w/ cookies&quot; and &quot;Hide certificate errors&quot;, so use the options with care.
|
||||
Global redirection Global redirection is enabled with the setting option &quot;Resource redirection&quot;.
|
||||
<description>⚠️Redirection forwards cookies with the setting option &quot;Redirect cookies&quot; enabled, so use the options with care.
|
||||
Setting options: &quot;Url redirection&quot; vs. &quot;Resource redirection&quot; &quot;Url redirection&quot; redirects the main/page url only while &quot;Resource redirection&quot; is for all urls in the page.
|
||||
Global redirection Global redirection is enabled with the setting option &quot;Resource redirection&quot; or both &quot;Url redirection&quot; and &quot;Redirect cookies&quot;.
|
||||
When a valid global redirection url is set, the &quot;default.redirect&quot; has no effect, and any url resource is fetched with the new url by appending the original url to the global redirection url.</description>
|
||||
</item>
|
||||
|
||||
|
|
|
@ -63,13 +63,13 @@ uweb, termux &amp; history versions
|
|||
github
|
||||
sourceforge
|
||||
powerfolder
|
||||
pcloud
|
||||
pagure
|
||||
Main features Change logs 991: global url redirection support.
|
||||
988: hosts file to support response headers.
|
||||
985: Special urls to support shortcut keys such as ctrl-a to ctrl-z.
|
||||
983: support &quot;hosts&quot; file domain name resolving (no root needed), only single space allowed as separator for ip address and domain name.
|
||||
975: Bookmarks to support styling for markdown etc.
|
||||
971: multiple type profiles: switch any data including website logins, user configurations orthogonally.</description>
|
||||
975: Bookmarks to support styling for markdown etc.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<sitemap>
|
||||
<loc>en/sitemap.xml</loc>
|
||||
|
||||
<lastmod>2023-04-14T16:04:50+08:00</lastmod>
|
||||
<lastmod>2023-04-15T18:08:03+08:00</lastmod>
|
||||
|
||||
</sitemap>
|
||||
|
||||
|
|
Loading…
Reference in a new issue