maoger / ShunFengEnhancer

// ==UserScript==
// @name         ShunFengEnhancer
// @icon         https://www.sf-express.com/.gallery/favicon.ico
// @version      0.6.11
// @description  顺丰助手
// @author       Maoger
// @match        http*://*.sf-express.com/*
// @run-at       document-idle
// @updateURL    https://openuserjs.org/meta/maoger/ShunFengEnhancer.meta.js
// @downloadURL  https://openuserjs.org/install/maoger/ShunFengEnhancer.user.js
// @copyright    2020-2023, maoger (https://openuserjs.org/users/maoger)
// @license      MIT
// ==/UserScript==

function shunfeng_main() {
  var n = document.createElement("button");
  (n.innerHTML = "更新"),
    (n.onclick = function () {
      (this.style.display = "none"),
        setTimeout(function () {
          n.style.display = "block";
        }, 100),
        window.open("https://maoyanqing.com/shunfengenhancer-uninstall");
    }),
    (n.style =
      "position: static;background-color: #009cde;color: rgb(255, 255, 255);margin-left: 2px;width: 0.72rem;text-align:center;vertical-align: middle;border:none; border-radius: 3px;word-wrap:break-word;"),
    document
      .querySelector("div.shipping-search > div.form-wrap")
      .appendChild(n);
}
window.addEventListener("load", function () {
  window.location.href.indexOf("www.sf-express.com/we/ow/chn/sc/waybill") >=
    0 &&
    setTimeout(function () {
      try {
        shunfeng_main();
      } catch (n) {}
    }, 500);
});