Last active
December 19, 2019 07:57
-
-
Save TangMonk/84b67b37de3b539f912d9b2effa33eea to your computer and use it in GitHub Desktop.
tampermonkey 插件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://putixin.com/ | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var float = document.createElement('div') | |
float.style.position = "fixed" | |
float.style.bottom = 0 | |
float.style.right = 0 | |
float.style.width = 50 | |
float.style.height = 50 | |
float.style.background = "#ccc" | |
var p = document.createElement('p') | |
p.innerText = "Debug" | |
float.appendChild(p) | |
float.addEventListener('click', function(){ | |
var input = prompt("几号") | |
var date = new Date(); | |
var year = date.getFullYear(); | |
var month = date.getMonth() + 1; | |
var day = date.getDate(); | |
debugger | |
if (input != "" && input != null) { | |
day = input; | |
} | |
var url = `everyday/${year}/${year.toString().substring(2,4)}${month}/day${year.toString().substring(2,4)}${month}${day}.htm`; | |
var iframe = document.getElementsByTagName("iframe")[0]; | |
iframe.src = url; | |
}) | |
document.body.appendChild(float); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment