木子屋 Dnawo's BLOG

Tampermonkey脚本模板:Hello World!

👤 dnawo 📅 2020-02-25 👁 2429 👍 0 💬 0 🔄 来源:本站原创
图片

图片

// ==UserScript==
// @name         mz_demo
// @namespace    com.mzwu.www
// @description  mzwu.com userscripts demo.
// @include      https://www.mzwu.com/*
// @require      http://code.jquery.com/jquery-1.12.4.min.js
// @run-at       document-end
// @author       dnawo
// @version      1.0
// ==/UserScript==

(function() {
    'use strict';
    
    try
    {
        if (typeof jQuery == "function") {
            $.noConflict();
            jQuery(document).ready(function($) {
                // Your code here...
                alert($("title").text());
            });
        }
    }
    catch(ex)
    {
        alert("err:" + ex);
    }
})();

参考资料

[1].API 文档:https://www.tampermonkey.net/documentation.php
[2].常见问题:https://www.tampermonkey.net/faq.php?ext=dhdg
[3].Userscripts:https://userscripts-mirror.org/
[4].Greasy Fork:https://greasyfork.org/zh-CN
[5].OpenUserJS :https://openuserjs.org/

评论(0)

暂无评论。

验证码
评论需审核通过后显示
← 上一篇 C#实用扩展方法整理收集 下一篇 → Javascript严格模式(use strict)使用示例