為了能順順找小說只好去找GreaseMonkey的教學自己動手了...- // ==UserScript==
- // @name ck101
- // @namespace ck101.com
- // @include http://*.ck101.com/*
- // @include http://ck101.com/*
- // @version 1
- // @grant none
- // ==/UserScript==
- function getElementsByClass( searchClass, domNode, tagName) {
- if (domNode == null) domNode = document;
- if (tagName == null) tagName = '*';
- var el = new Array();
- var tags = domNode.getElementsByTagName(tagName);
- var tcl = " "+searchClass+" ";
- for(i=0,j=0; i<tags.length; i++) {
- var test = " " + tags[i].className + " ";
- if (test.indexOf(tcl) != -1) {
- el[j++] = tags[i];
- }
- }
- return el;
- }
- function deleteElementsByClass( searchClass, domNode, tagName) {
- if (domNode == null) domNode = document;
- if (tagName == null) tagName = '*';
- var el = new Array();
- var tags = domNode.getElementsByTagName(tagName);
- var tcl = " "+searchClass+" ";
- for(i=0,j=0; i<tags.length; i++) {
- var test = " " + tags[i].className + " ";
- if (test.indexOf(tcl) != -1) {
- tags[i].parentNode.removeChild(tags[i]);
- }
- }
- }
- function deleteElementCSSWidthByClass( searchClass, domNode, tagName) {
- if (domNode == null) domNode = document;
- if (tagName == null) tagName = '*';
- var el = new Array();
- var tags = domNode.getElementsByTagName(tagName);
- var tcl = " "+searchClass+" ";
- for(i=0,j=0; i<tags.length; i++) {
- var test = " " + tags[i].className + " ";
- if (test.indexOf(tcl) != -1) {
- tags[i].style.width='100%';
- }
- }
- }
- //deleteElementsByClass('a_t');
- //deleteElementsByClass('side');
- //deleteElementCSSWidthByClass('viewthread');
- //deleteElementCSSWidthByClass('container');
- var tp = getElementsByClass('thumb_preview');
- if (tp.length > 0) {
- var tags = getElementsByClass('bm_c')[1].getElementsByTagName('*');
- for (i=0; i<tags.length; i++) {
- if (tags[i].nodeName.indexOf('TD') != -1) {
- tags[i].parentNode.removeChild(tags[i]);
- } else if (tags[i].nodeName == 'P') {
- tags[i].parentNode.removeChild(tags[i]);
- var tmp = tags[i];
- while(tmp.firstChild) {
- if (tmp.firstChild.className == 'tps') {
- tmp.parentNode.insertBefore(tmp.firstChild, tmp);
- }
- tmp.removeChild(tmp.firstChild);
- }
- tmp.parentNode.removeChild(tmp);
- }
- }
- }
複製代碼 |