EhSyringe
EhSyringe copied to clipboard
exh和e-h切换功能
描述你想要的功能 希望能加设计一个按钮,切换e-hantai和exhentai。
描述你想要的功能 希望能加设计一个按钮,切换e-hantai和exhentai。
虽然和作为翻译插件的初衷不同,但有这个功能会方便很多。
使用场景是啥?
这个功能不应该集成在EhSyringe中。可以考虑用 userscript 单独写个插件。 说实话我也不是很明白这样做到底有什么作用。 我倒是想到如果因为特定标签表站屏蔽的作品写个插件自动跳转到里站。
// ==UserScript==
// @name 表里站切换按钮
// @namespace com.xioxin.switchsite
// @version 0.1
// @description switch site
// @author xioxin
// @match *://exhentai.org/*
// @match *://e-hentai.org/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const x = location.host[1] === 'x';
const a = document.createElement('a');
const u = new URL(location.href);
u.host = 'e' + (x ? '-' : 'x') + u.host.slice(2);
a.href = u.href;
a.style.position = 'fixed';
a.style.right = 0;
a.style.top = 0;
a.textContent = (x ? '表' : '里')
document.body.append(a);
})();
这个功能不应该集成在EhSyringe中。可以考虑用 userscript 单独写个插件。 说实话我也不是很明白这样做到底有什么作用。 我倒是想到如果因为特定标签表站屏蔽的作品写个插件自动跳转到里站。
使用场景确实不是很多。
有些人喜欢用里站有些人喜欢用表站(比如把里站做特殊用或者要玩HV和H@H 这些只有表站有入口),如果一个喜欢用表站的人收到了一个里站的链接,加上切换功能可以让使用体验更统一。
// ==UserScript== // @name 表里站切换按钮 // @namespace com.xioxin.switchsite // @version 0.1 // @description switch site // @author xioxin // @match *://exhentai.org/* // @match *://e-hentai.org/* // @grant none // ==/UserScript== (function() { 'use strict'; const x = location.host[1] === 'x'; const a = document.createElement('a'); const u = new URL(location.href); u.host = 'e' + (x ? '-' : 'x') + u.host.slice(2); a.href = u.href; a.style.position = 'fixed'; a.style.right = 0; a.style.top = 0; a.textContent = (x ? '表' : '里') document.body.append(a); })();
谢谢,已经完美解决需求。
另外问一下,怎么把改按键改大一点?
// ==UserScript==
// @name 表里站切换按钮
// @namespace com.xioxin.switchsite
// @version 0.1
// @description switch site
// @author xioxin
// @match *://exhentai.org/*
// @match *://e-hentai.org/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const x = location.host[1] === 'x';
const a = document.createElement('a');
const u = new URL(location.href);
u.host = 'e' + (x ? '-' : 'x') + u.host.slice(2);
a.href = u.href;
a.style.position = 'fixed';
a.style.right = '4px'; // 右边距离
a.style.top = '4px'; // 上边距离
a.style.fontSize = '24px'; // 字体大小
a.textContent = (x ? '表' : '里')
document.body.append(a);
})();