TorcAddons-watch-json-file

provides a watch.json button, to spawn a watch.json file, and set it's contents automatically to that to be compatible with torcAddons-ManualUpdate

当前为 2020-04-05 提交的版本,查看 最新版本

// ==UserScript==
// @name         TorcAddons-watch-json-file
// @namespace    http://torcado.com
// @description  provides a watch.json button, to spawn a watch.json file, and set it's contents automatically to that to be compatible with torcAddons-ManualUpdate
// @author       torcado and J-Tech-Foundation
// @license      MIT
// @icon         http://torcado.com/torcAddons/icon.png
// @run-at       document-start
// @grant        none
// @include      http*://glitch.com/edit/*
// @version 0.0.1.20200121105718
// ==/UserScript==
(function () {
    let t = torcAddons;

    t.addEventListener('load', ()=>{
        let code = `{
  "install": {
    "include": [
      "^.torc-update"
    ]
  },
  "throttle": 10
}`;
        var gg = document.createElement("div")
        gg.className = "torc-update"
        document.getElementByName("nav")[0].appendChild(gg)
        let FI = application.fileByPath("watch.json");
        if (FI === undefined) {
            application.newFile("watch.json").then(f => {
                application.writeToFile(f, code);
            });
        } else {
            application.writeToFile(FI, code);
        }
    });
})();