Code Monkey home page Code Monkey logo

Comments (7)

o-liverkk avatar o-liverkk commented on June 11, 2024

描述你想要的功能 希望能加设计一个按钮,切换e-hantai和exhentai。

虽然和作为翻译插件的初衷不同,但有这个功能会方便很多。

from ehsyringe.

OpportunityLiu avatar OpportunityLiu commented on June 11, 2024

使用场景是啥?

from ehsyringe.

xioxin avatar xioxin commented on June 11, 2024

这个功能不应该集成在EhSyringe中。可以考虑用 userscript 单独写个插件。
说实话我也不是很明白这样做到底有什么作用。
我倒是想到如果因为特定标签表站屏蔽的作品写个插件自动跳转到里站。

from ehsyringe.

xioxin avatar xioxin commented on June 11, 2024
// ==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);
})();

image

from ehsyringe.

o-liverkk avatar o-liverkk commented on June 11, 2024

这个功能不应该集成在EhSyringe中。可以考虑用 userscript 单独写个插件。 说实话我也不是很明白这样做到底有什么作用。 我倒是想到如果因为特定标签表站屏蔽的作品写个插件自动跳转到里站。

使用场景确实不是很多。

有些人喜欢用里站有些人喜欢用表站(比如把里站做特殊用或者要玩HV和H@H 这些只有表站有入口),如果一个喜欢用表站的人收到了一个里站的链接,加上切换功能可以让使用体验更统一。

from ehsyringe.

o-liverkk avatar o-liverkk commented on June 11, 2024
// ==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);
})();
image

谢谢,已经完美解决需求。

另外问一下,怎么把改按键改大一点?

from ehsyringe.

xioxin avatar xioxin commented on June 11, 2024
// ==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);
})();

from ehsyringe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.