GM_update Tester

GM_Update is a library that allows you to update your script from any site that support meta.js standard or the main USO alternatives: OpenUserJS, Greasy Fork and MonkeyGuts.

Pada tanggal 23 Agustus 2014. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name                GM_update Tester
// @namespace           TimidScript
// @description         GM_Update is a library that allows you to update your script from any site that support meta.js standard or the main USO alternatives: OpenUserJS, Greasy Fork and MonkeyGuts.
// @include             www.example.com
// @version             3
// @require             http://openuserjs.org/src/libs/TimidScript/TSL_-_GM_Update.js
// @icon                http://i.imgur.com/FD46Ak3.png?1
// @include             *//www.example.com*
// @include             *//example.com*
// @grant               GM_xmlhttpRequest
// @grant               GM_info
// @grant               GM_getMetadata
// @grant               GM_getValue
// @grant               GM_setValue
// @grant               GM_deleteValue
// @grant               GM_registerMenuCommand
// @homeurl             https://openuserjs.org/scripts/TimidScript/GM_update_Tester
// ==/UserScript==

// @gm_update           manual
var notice = document.createElement("div");
notice.setAttribute("style", "position: fixed; top: 10px; right: 10px; width: 400px; color: green; background-color: #E7E7F1; z-index: 999999999999; padding: 10px; border: 3px solid pink; margin: 0; text-align: center;");
notice.innerHTML = "Click the button below to do a manual check using <a href='https://greasyfork.org/scripts/4439'>"
    + "GM_update Tester's meta.js</a> file hosted on Greasy Fork. The result is printed in the console."
    + "Or you can select the GreaseMonkey menu command to do an update check from "
    + "<a href='https://openuserjs.org/scripts/TimidScript/GM_update_Tester'> OpenUserJS homepage.";

document.body.appendChild(notice);

var btn = document.createElement("div");
btn.setAttribute("style", "margin: 5px; padding:5px; text-align: center; border: 1px red solid; background-color: #FBF8C8; color: red;  border-radius: 5px; width: 380px; cursor: pointer;");
btn.textContent = "Console Print Online Version";
btn.onclick = WhyClick;
notice.appendChild(btn);


function WhyClick()
{
    try
    {
        console.log(GM_update)
    }
    catch (e) { console.warn(e); }

    var url = "https://greasyfork.org/scripts/4439/code/4439.meta.js";
    GM_update.isThereANewVersion(url, updateCallback);
}

function updateCallback(success)
{
    console.log("Has new version check succeeded: ", success);
    if (success)
    {
        console.info("Do Version Match: ", GM_update.online.version == GM_update.installed.version);
        console.log(GM_update.online);
        console.log(GM_update.installed);
    }
}