// ==UserScript== // @name 新浪秀场清屏 // @namespace https://greasyfork.org/scripts/ // @description 进入房间时关闭特效并清屏。 // @author softiger // @version 0.1 // @include http://ok.sina.com.cn/9* // @grant GM_addStyle // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js // @history 0.1 Initial release. // @downloadURL none // ==/UserScript== /* Element.prototype.remove = function() { this.parentElement.removeChild(this); } NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = 0, len = this.length; i < len; i++) { if(this[i] && this[i].parentElement) { this[i].parentElement.removeChild(this[i]); } } } document.getElementById("my-element").remove(); document.getElementsByClassName("my-elements")[0].remove(); */ /*--- Create a button in a container div. It will be styled and positioned with CSS. */ var zNode = document.createElement ('div'); zNode.innerHTML = ''; zNode.setAttribute ('id', 'myContainer'); document.body.appendChild (zNode); //--- Activate the newly added button. document.getElementById ("myButton").addEventListener ( "click", ButtonClickAction, false ); function ButtonClickAction (zEvent) { $("#goto_phone_link").remove(); $("#quest_qd").remove(); $("#quest_button").remove(); $("#quest_box").remove(); $("#goto_top_tag").remove(); $("#imBox").remove(); } $(document).ready(function(){ document.getElementById ("btnshowgift").click(); document.getElementsByClassName ("box_main")[0].getElementsByTagName ("a")[0].click(); /*for (var i = 1; i < 35; i++) clearInterval(i);*/ }); //--- Style our newly added elements using CSS. GM_addStyle ( multilineStr ( function () {/*! #myContainer { position: absolute; top: 25em; left: 24em; font-size: 20px; background: orange; border: 3px outset black; margin: 5px; opacity: 0.5; z-index: 9999; padding: 1px 2px; } #myButton { cursor: pointer; } */} ) ); function multilineStr (dummyFunc) { var str = dummyFunc.toString (); str = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*! .replace (/\s*\*\/\s*\}\s*$/, '') // Strip */ } .replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them. ; return str; }