您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add "It's all Blink's fault." to every sentence you write in the shoutbox.
当前为
- // ==UserScript==
- // @name It's all Blink's fault.
- // @description Add "It's all Blink's fault." to every sentence you write in the shoutbox.
- // @include http://harddrop.com/file/shout/shout.php
- // @namespace https://greasyfork.org/users/2233
- // @version 0.0.1.20140716100521
- // ==/UserScript==
- var wnd = window
- var doc = wnd.document
- var loc = location
- var href = loc.href
- if(doc.getElementById('ShoutCloud-Container')==null) { throw 'exit' }
- // enable the input box
- setTimeout("",2000)
- addEventListener('load', function(){
- doc.getElementsByName('ShoutCloud-Msg')[0].disabled=false
- doc.getElementsByName('ShoutCloud-Msg')[0].value=''
- }, false)
- // don't clear unsent text when unfocuing the input box
- doc.getElementsByName('ShoutCloud-Msg')[0].onblur = function(){ return }
- addEventListener('keydown', function(evt){
- if(evt.keyCode==13)
- {
- evt.preventDefault()
- var my_chat = doc.getElementsByName('ShoutCloud-Msg')[0].value
- if(!/[a-zA-Z0-9]$/.test(my_chat[my_chat.length-1])) // end with punctuation
- {
- my_chat = my_chat + " It's all Blink's fault."
- }
- else
- {
- my_chat = my_chat + ". It's all Blink's fault."
- }
- doc.getElementsByName('ShoutCloud-Msg')[0].value = my_chat
- doc.getElementById('ShoutCloud-Shout').click()
- }
- }, false)