Code Monkey home page Code Monkey logo

Comments (4)

conwnet avatar conwnet commented on July 30, 2024 3

https://www.v2ex.com/t/752197?p=1#r_10177333
热心 v2ex 网友已经开发了 Tampermonkey 脚本,直接可用的 chrome 插件后续也可以抽时间搞一个~

from github1s.

seognil avatar seognil commented on July 30, 2024

自取(

{
  const BTN_ID = "github-online-editor-button";

  const run = () => {
    const ul = document.querySelector(".pagehead-actions");

    // * ----------------

    if (!ul) return;
    if (ul.querySelector(`#${BTN_ID}`)) return;

    // * ----------------

    const li = document.createElement("li");

    li.id = BTN_ID;

    li.style.borderRadius = "6px";
    li.style.border = "1px solid hsl(0deg 0% 20%)";
    li.style.padding = "3px 12px";
    li.style.cursor = "pointer";
    li.style.lineHeight = "20px";

    li.textContent = "+1s";

    ul.prepend(li);

    // * ----------------

    li.addEventListener("click", () => {
      const github1s = location.href.replace("github.com", "github1s.com");
      window.open(github1s);
    });
  };

  new MutationObserver(run).observe(document, {
    childList: true,
    subtree: true,
  });

  run();
}

from github1s.

febaoshan avatar febaoshan commented on July 30, 2024

感谢大佬,借着你的这个东西,撸了个可以用于edge和chrome的插件。
源码和使用方法在这:https://github.com/febaoshan/edge-extensions-github-code-viewer

edge商店审核中,chrome无法支付5美元,所以现阶段只能下载源码解压后用浏览器的开发者模式加载解压的扩展程序。
有chrome开发者账号的可以直接发布插件,但是名字需要为:github-code-viewer。

谢谢。

from github1s.

xcv58 avatar xcv58 commented on July 30, 2024

There are a couple of extensions in https://github.com/conwnet/github1s#chrome-extensions

from github1s.

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.