Giter VIP home page Giter VIP logo

tampermonkey-scripts's Introduction

tampermonkey-template

油猴脚本模板,支持热更新,开发更便捷。

1. 开发流程

开发环境
Node: 14.15.0

tampermonkey.js 代码复制到油猴脚本编辑器,然后在本地进行开发,开发完成之然后把 app.bundle.js 文件的内容替换到下面标注的文本。

// ==UserScript==
// @name         tampermonkey-template
// @namespace    https://github.com/dlzmoe/tampermonkey-template
// @version      0.0.1
// @description  tampermonkey-template
// @author       dlzmoe
// @match        http://*/*
// @match        https://*/*
// @icon         https://www.google.com/chrome/static/images/chrome-logo-m100.svg
// @require      https://cdn.bootcss.com/jquery/3.6.0/jquery.min.js
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  'use strict';
  // 替换
  if (location.href === "http://localhost:8080/") return
  let script = document.createElement('script')
  script.src = 'http://localhost:8080/app.bundle.js'
  document.body.appendChild(script)
  // 替换
})();

安装依赖并运行。

yarn 
yarn dev 
# or
npm install
npm run start

本地运行后显示 Compiled successfully. 即为成功,打开 http://localhost:8080/ 可以看到一个示例 demo。

2. 参考项目

3. LICENSE

MIT License

tampermonkey-scripts's People

Contributors

anghunk1 avatar dlzmoe avatar

Stargazers

 avatar

Watchers

 avatar

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.