Merge pull request #6 from Liu8Can/master
feat: add 163 VIP webmail provider support
This commit is contained in:
+10
-1
@@ -223,6 +223,12 @@ function isSignupPageHost(hostname = '') {
|
|||||||
return ['auth0.openai.com', 'auth.openai.com', 'accounts.openai.com'].includes(hostname);
|
return ['auth0.openai.com', 'auth.openai.com', 'accounts.openai.com'].includes(hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is163MailHost(hostname = '') {
|
||||||
|
return hostname === 'mail.163.com'
|
||||||
|
|| hostname.endsWith('.mail.163.com')
|
||||||
|
|| hostname === 'webmail.vip.163.com';
|
||||||
|
}
|
||||||
|
|
||||||
function buildLocalhostCleanupPrefix(rawUrl) {
|
function buildLocalhostCleanupPrefix(rawUrl) {
|
||||||
const parsed = parseUrlSafely(rawUrl);
|
const parsed = parseUrlSafely(rawUrl);
|
||||||
if (!parsed || parsed.hostname !== 'localhost') return '';
|
if (!parsed || parsed.hostname !== 'localhost') return '';
|
||||||
@@ -249,7 +255,7 @@ function matchesSourceUrlFamily(source, candidateUrl, referenceUrl) {
|
|||||||
case 'qq-mail':
|
case 'qq-mail':
|
||||||
return candidate.hostname === 'mail.qq.com' || candidate.hostname === 'wx.mail.qq.com';
|
return candidate.hostname === 'mail.qq.com' || candidate.hostname === 'wx.mail.qq.com';
|
||||||
case 'mail-163':
|
case 'mail-163':
|
||||||
return candidate.hostname === 'mail.163.com' || candidate.hostname.endsWith('.mail.163.com');
|
return is163MailHost(candidate.hostname);
|
||||||
case 'inbucket-mail':
|
case 'inbucket-mail':
|
||||||
return Boolean(reference)
|
return Boolean(reference)
|
||||||
&& candidate.origin === reference.origin
|
&& candidate.origin === reference.origin
|
||||||
@@ -1764,6 +1770,9 @@ function getMailConfig(state) {
|
|||||||
if (provider === '163') {
|
if (provider === '163') {
|
||||||
return { source: 'mail-163', url: 'https://mail.163.com/js6/main.jsp?df=mail163_letter#module=mbox.ListModule%7C%7B%22fid%22%3A1%2C%22order%22%3A%22date%22%2C%22desc%22%3Atrue%7D', label: '163 邮箱' };
|
return { source: 'mail-163', url: 'https://mail.163.com/js6/main.jsp?df=mail163_letter#module=mbox.ListModule%7C%7B%22fid%22%3A1%2C%22order%22%3A%22date%22%2C%22desc%22%3Atrue%7D', label: '163 邮箱' };
|
||||||
}
|
}
|
||||||
|
if (provider === '163-vip') {
|
||||||
|
return { source: 'mail-163', url: 'https://webmail.vip.163.com/js6/main.jsp?df=mail163_letter#module=mbox.ListModule%7C%7B%22fid%22%3A1%2C%22order%22%3A%22date%22%2C%22desc%22%3Atrue%7D', label: '163 VIP 邮箱' };
|
||||||
|
}
|
||||||
if (provider === 'inbucket') {
|
if (provider === 'inbucket') {
|
||||||
const host = normalizeInbucketOrigin(state.inbucketHost);
|
const host = normalizeInbucketOrigin(state.inbucketHost);
|
||||||
const mailbox = (state.inbucketMailbox || '').trim();
|
const mailbox = (state.inbucketMailbox || '').trim();
|
||||||
|
|||||||
+3
-2
@@ -3,9 +3,10 @@
|
|||||||
const SCRIPT_SOURCE = (() => {
|
const SCRIPT_SOURCE = (() => {
|
||||||
if (window.__MULTIPAGE_SOURCE) return window.__MULTIPAGE_SOURCE;
|
if (window.__MULTIPAGE_SOURCE) return window.__MULTIPAGE_SOURCE;
|
||||||
const url = location.href;
|
const url = location.href;
|
||||||
|
const hostname = location.hostname;
|
||||||
if (url.includes('auth0.openai.com') || url.includes('auth.openai.com') || url.includes('accounts.openai.com')) return 'signup-page';
|
if (url.includes('auth0.openai.com') || url.includes('auth.openai.com') || url.includes('accounts.openai.com')) return 'signup-page';
|
||||||
if (url.includes('mail.qq.com')) return 'qq-mail';
|
if (hostname === 'mail.qq.com' || hostname === 'wx.mail.qq.com') return 'qq-mail';
|
||||||
if (url.includes('mail.163.com')) return 'mail-163';
|
if (hostname === 'mail.163.com' || hostname.endsWith('.mail.163.com') || hostname === 'webmail.vip.163.com') return 'mail-163';
|
||||||
if (url.includes('duckduckgo.com/email/settings/autofill')) return 'duck-mail';
|
if (url.includes('duckduckgo.com/email/settings/autofill')) return 'duck-mail';
|
||||||
if (url.includes('chatgpt.com')) return 'chatgpt';
|
if (url.includes('chatgpt.com')) return 'chatgpt';
|
||||||
// VPS panel — detected dynamically since URL is configurable
|
// VPS panel — detected dynamically since URL is configurable
|
||||||
|
|||||||
+2
-1
@@ -43,7 +43,8 @@
|
|||||||
{
|
{
|
||||||
"matches": [
|
"matches": [
|
||||||
"https://mail.163.com/*",
|
"https://mail.163.com/*",
|
||||||
"https://*.mail.163.com/*"
|
"https://*.mail.163.com/*",
|
||||||
|
"https://webmail.vip.163.com/*"
|
||||||
],
|
],
|
||||||
"js": ["content/utils.js", "content/mail-163.js"],
|
"js": ["content/utils.js", "content/mail-163.js"],
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
<span class="data-label">邮箱服务</span>
|
<span class="data-label">邮箱服务</span>
|
||||||
<select id="select-mail-provider" class="data-select">
|
<select id="select-mail-provider" class="data-select">
|
||||||
<option value="163">163 邮箱 (mail.163.com)</option>
|
<option value="163">163 邮箱 (mail.163.com)</option>
|
||||||
|
<option value="163-vip">163 VIP 邮箱 (webmail.vip.163.com)</option>
|
||||||
<option value="qq">QQ 邮箱 (wx.mail.qq.com)</option>
|
<option value="qq">QQ 邮箱 (wx.mail.qq.com)</option>
|
||||||
<option value="inbucket">Inbucket(自定义主机)</option>
|
<option value="inbucket">Inbucket(自定义主机)</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user