去除贴吧列表里面的广告

去除贴吧掺夹在[帖子列表][回复列表]里的广告

  1. // ==UserScript==
  2. // @name 去除贴吧列表里面的广告
  3. // @author axetroy
  4. // @description 去除贴吧掺夹在[帖子列表][回复列表]里的广告
  5. // @version 2016.6.4
  6. // @include http://tieba.baidu.com/*
  7. // @connect tags
  8. // @connect *
  9. // @compatible chrome 完美运行
  10. // @compatible firefox 完美运行
  11. // @supportURL http://www.burningall.com
  12. // @run-at document-start
  13. // @contributionURL troy450409405@gmail.com|alipay.com
  14. // @namespace https://gf.qytechs.cn/zh-CN/users/3400-axetroy
  15. // @license The MIT License (MIT); http://opensource.org/licenses/MIT
  16. // ==/UserScript==
  17.  
  18. /*
  19.  
  20. Github源码:https://github.com/axetroy/GMscript
  21.  
  22. */
  23. /******/ (function(modules) { // webpackBootstrap
  24. /******/ // The module cache
  25. /******/ var installedModules = {};
  26.  
  27. /******/ // The require function
  28. /******/ function __webpack_require__(moduleId) {
  29.  
  30. /******/ // Check if module is in cache
  31. /******/ if(installedModules[moduleId])
  32. /******/ return installedModules[moduleId].exports;
  33.  
  34. /******/ // Create a new module (and put it into the cache)
  35. /******/ var module = installedModules[moduleId] = {
  36. /******/ exports: {},
  37. /******/ id: moduleId,
  38. /******/ loaded: false
  39. /******/ };
  40.  
  41. /******/ // Execute the module function
  42. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  43.  
  44. /******/ // Flag the module as loaded
  45. /******/ module.loaded = true;
  46.  
  47. /******/ // Return the exports of the module
  48. /******/ return module.exports;
  49. /******/ }
  50.  
  51.  
  52. /******/ // expose the modules object (__webpack_modules__)
  53. /******/ __webpack_require__.m = modules;
  54.  
  55. /******/ // expose the module cache
  56. /******/ __webpack_require__.c = installedModules;
  57.  
  58. /******/ // __webpack_public_path__
  59. /******/ __webpack_require__.p = "";
  60.  
  61. /******/ // Load entry module and return exports
  62. /******/ return __webpack_require__(0);
  63. /******/ })
  64. /************************************************************************/
  65. /******/ ([
  66. /* 0 */
  67. /***/ function(module, exports, __webpack_require__) {
  68.  
  69. 'use strict';
  70.  
  71. __webpack_require__(58);
  72.  
  73. /***/ },
  74. /* 1 */
  75. /***/ function(module, exports, __webpack_require__) {
  76.  
  77. 'use strict';
  78.  
  79. // es6 Array.from
  80.  
  81. Object.defineProperty(exports, "__esModule", {
  82. value: true
  83. });
  84.  
  85. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
  86.  
  87. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  88. // es6 Object.assign
  89.  
  90.  
  91. __webpack_require__(2);
  92.  
  93. __webpack_require__(30);
  94.  
  95. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  96.  
  97. var noop = function noop(x) {
  98. return x;
  99. };
  100.  
  101. var jqLite = function () {
  102. function jqLite() {
  103. var _this = this;
  104.  
  105. var selectors = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
  106. var context = arguments.length <= 1 || arguments[1] === undefined ? document : arguments[1];
  107.  
  108. _classCallCheck(this, jqLite);
  109.  
  110. this.selectors = selectors;
  111. this.context = context;
  112. this.length = 0;
  113.  
  114. switch (typeof selectors === 'undefined' ? 'undefined' : _typeof(selectors)) {
  115. case 'undefined':
  116. break;
  117. case 'string':
  118. Array.from(context.querySelectorAll(selectors), function (ele, i) {
  119. _this[i] = ele;
  120. _this.length++;
  121. }, this);
  122. break;
  123. case 'object':
  124. if (selectors.length) {
  125. Array.from(selectors, function (ele, i) {
  126. _this[i] = ele;
  127. _this.length++;
  128. }, this);
  129. } else {
  130. this[0] = selectors;
  131. this.length = 1;
  132. }
  133. break;
  134. case 'function':
  135. this.ready(selectors);
  136. break;
  137. default:
  138.  
  139. }
  140. }
  141.  
  142. _createClass(jqLite, [{
  143. key: 'eq',
  144. value: function eq() {
  145. var n = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
  146.  
  147. return new jqLite(this[n]);
  148. }
  149. }, {
  150. key: 'find',
  151. value: function find(selectors) {
  152. return new jqLite(selectors, this[0]);
  153. }
  154. }, {
  155. key: 'each',
  156. value: function each() {
  157. var fn = arguments.length <= 0 || arguments[0] === undefined ? noop : arguments[0];
  158.  
  159. for (var i = 0; i < this.length; i++) {
  160. fn.call(this, this[i], i);
  161. }
  162. return this;
  163. }
  164. }, {
  165. key: 'bind',
  166. value: function bind() {
  167. var types = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
  168. var fn = arguments.length <= 1 || arguments[1] === undefined ? noop : arguments[1];
  169.  
  170. this.each(function (ele) {
  171. types.trim().split(/\s{1,}/).forEach(function (type) {
  172. ele.addEventListener(type, function (e) {
  173. var target = e.target || e.srcElement;
  174. if (fn.call(target, e) === false) {
  175. e.returnValue = true;
  176. e.cancelBubble = true;
  177. e.preventDefault && e.preventDefault();
  178. e.stopPropagation && e.stopPropagation();
  179. return false;
  180. }
  181. }, false);
  182. });
  183. });
  184. }
  185. }, {
  186. key: 'click',
  187. value: function click() {
  188. var fn = arguments.length <= 0 || arguments[0] === undefined ? noop : arguments[0];
  189.  
  190. this.bind('click', fn);
  191. return this;
  192. }
  193. }, {
  194. key: 'ready',
  195. value: function ready() {
  196. var _this2 = this;
  197.  
  198. var fn = arguments.length <= 0 || arguments[0] === undefined ? noop : arguments[0];
  199.  
  200. window.addEventListener('DOMContentLoaded', function (e) {
  201. fn.call(_this2, e);
  202. }, false);
  203. }
  204. }, {
  205. key: 'observe',
  206. value: function observe() {
  207. var _this3 = this;
  208.  
  209. var fn = arguments.length <= 0 || arguments[0] === undefined ? noop : arguments[0];
  210. var config = arguments.length <= 1 || arguments[1] === undefined ? { childList: true, subtree: true } : arguments[1];
  211.  
  212. this.each(function (ele) {
  213. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  214. var observer = new MutationObserver(function (mutations) {
  215. mutations.forEach(function (mutation) {
  216. fn.call(_this3, mutation.target, mutation.addedNodes, mutation.removedNodes);
  217. });
  218. });
  219. observer.observe(ele, config);
  220. });
  221. return this;
  222. }
  223. }, {
  224. key: 'attr',
  225. value: function (_attr) {
  226. function attr(_x, _x2) {
  227. return _attr.apply(this, arguments);
  228. }
  229.  
  230. attr.toString = function () {
  231. return _attr.toString();
  232. };
  233.  
  234. return attr;
  235. }(function (attr, value) {
  236. // one agm
  237. if (arguments.length === 1) {
  238. // get attr value
  239. if (typeof attr === 'string') {
  240. return this[0].getAttribute(attr);
  241. }
  242. // set attr with a json
  243. else if ((typeof attr === 'undefined' ? 'undefined' : _typeof(attr)) === 'object') {
  244. this.each(function (ele) {
  245. for (var at in attr) {
  246. if (attr.hasOwnProperty(at)) {
  247. ele.setAttribute(at, value);
  248. }
  249. }
  250. });
  251. return value;
  252. }
  253. }
  254. // set
  255. else if (arguments.length === 2) {
  256. this.each(function (ele) {
  257. ele.setAttribute(attr, value);
  258. });
  259. return this;
  260. } else {
  261. return this;
  262. }
  263. })
  264. }, {
  265. key: 'removeAttr',
  266. value: function removeAttr(attr) {
  267. if (arguments.length === 1) {
  268. this.each(function (ele) {
  269. ele.removeAttribute(attr);
  270. });
  271. }
  272. return this;
  273. }
  274. }, {
  275. key: 'remove',
  276. value: function remove() {
  277. this.each(function (ele) {
  278. ele.remove();
  279. });
  280. this.length = 0;
  281. return this;
  282. }
  283.  
  284. // get the element style
  285.  
  286. }, {
  287. key: 'style',
  288. value: function style(attr) {
  289. return this[0].currentStyle ? this[0].currentStyle[attr] : getComputedStyle(this[0])[attr];
  290. }
  291.  
  292. // (attr,value) || 'string' || {}
  293.  
  294. }, {
  295. key: 'css',
  296. value: function css() {
  297. for (var _len = arguments.length, agm = Array(_len), _key = 0; _key < _len; _key++) {
  298. agm[_key] = arguments[_key];
  299. }
  300.  
  301. if (agm.length === 1) {
  302. // get style
  303. if (typeof agm[0] === 'string') {
  304. // set style as a long text
  305. if (/:/ig.test(agm[0])) {
  306. this.each(function (ele) {
  307. ele.style.cssText = attr;
  308. });
  309. } else {
  310. return this[0].currentStyle ? this[0].currentStyle[agm[0]] : getComputedStyle(this[0])[agm[0]];
  311. }
  312. }
  313. // set style as a object
  314. else {
  315. this.each(function (ele) {
  316. for (var _attr2 in agm[0]) {
  317. if (agm[0].hasOwnProperty(_attr2)) {
  318. ele.style[_attr2] = agm[0][_attr2];
  319. }
  320. }
  321. });
  322. }
  323. }
  324. // set as (key,value)
  325. else if (agm.length === 2) {
  326. this.each(function (ele) {
  327. ele.style[agm[0]] = agm[1];
  328. });
  329. }
  330. return this;
  331. }
  332. }, {
  333. key: 'width',
  334. value: function width(value) {
  335. var element = this[0];
  336. // window or document
  337. if (element.window === element || element.body) {
  338. return document.body.scrollWidth > document.documentElement.scrollWidth ? document.body.scrollWidth : document.documentElement.scrollWidth;
  339. }
  340. // set width
  341. else if (value) {
  342. this.each(function (ele) {
  343. ele.style.width = value + 'px';
  344. });
  345. return this;
  346. }
  347. // get width
  348. else {
  349. return this[0].offsetWidth || parseFloat(this.style('width'));
  350. }
  351. }
  352. }, {
  353. key: 'height',
  354. value: function height(value) {
  355. var ele = this[0];
  356. // window or document
  357. if (ele.window === ele || ele.body) {
  358. return document.body.scrollHeight > document.documentElement.scrollHeight ? document.body.scrollHeight : document.documentElement.scrollHeight;
  359. }
  360. // set height
  361. else if (value) {
  362. this.each(function (ele) {
  363. ele.style.height = value + 'px';
  364. });
  365. return this;
  366. }
  367. // get height
  368. else {
  369. return this[0].offsetHeight || parseFloat(this.style('height'));
  370. }
  371. }
  372. }, {
  373. key: 'html',
  374. value: function html(value) {
  375. if (value !== undefined) {
  376. this.each(function (ele) {
  377. ele.innerHTML = typeof value === 'function' ? value(ele) : value;
  378. });
  379. } else {
  380. return this[0].innerHTML;
  381. }
  382. return this;
  383. }
  384. }, {
  385. key: 'text',
  386. value: function text(value) {
  387. if (value === undefined) return this[0].innerText || this[0].textContent;
  388.  
  389. this.each(function (ele) {
  390. ele.innerText = ele.textContent = value;
  391. });
  392. return this;
  393. }
  394. }, {
  395. key: 'val',
  396. value: function val(value) {
  397. if (value === undefined) return this[0].value;
  398. this.each(function (ele) {
  399. ele.value = value;
  400. });
  401. return this;
  402. }
  403. }, {
  404. key: 'show',
  405. value: function show() {
  406. this.each(function (ele) {
  407. ele.style.display = '';
  408. });
  409. return this;
  410. }
  411. }, {
  412. key: 'hide',
  413. value: function hide() {
  414. this.each(function (ele) {
  415. ele.style.display = 'none';
  416. });
  417. return this;
  418. }
  419.  
  420. // content str || jqLite Object || DOM
  421. // here is jqLite Object
  422.  
  423. }, {
  424. key: 'append',
  425. value: function append(content) {
  426. this.each(function (ele) {
  427. ele.appendChild(content[0]);
  428. });
  429. return this;
  430. }
  431. }, {
  432. key: 'prepend',
  433.  
  434.  
  435. // content str || jqLite Object || DOM
  436. // here is jqLite Object
  437. value: function prepend(content) {
  438. this.each(function (ele) {
  439. ele.insertBefore(content[0], ele.children[0]);
  440. });
  441. return this;
  442. }
  443. }, {
  444. key: 'hasClass',
  445. value: function hasClass(className) {
  446. if (!this[0]) return false;
  447. return this[0].classList.contains(className);
  448. }
  449. }, {
  450. key: 'addClass',
  451. value: function addClass(className) {
  452. this.each(function (ele) {
  453. ele.classList.add(className);
  454. });
  455. return this;
  456. }
  457. }, {
  458. key: 'removeClass',
  459. value: function removeClass(className) {
  460. this.each(function (ele) {
  461. ele.classList.remove(className);
  462. });
  463. return this;
  464. }
  465. }, {
  466. key: 'index',
  467. get: function get() {
  468. var index = 0;
  469. var brothers = this[0].parentNode.children;
  470. for (var i = 0; i < brothers.length; i++) {
  471. if (brothers[i] == this[0]) {
  472. index = i;
  473. break;
  474. }
  475. }
  476. return index;
  477. }
  478. }], [{
  479. key: 'fn',
  480. get: function get() {
  481. var visible = function visible(ele) {
  482. var pos = ele.getBoundingClientRect();
  483. var w = void 0;
  484. var h = void 0;
  485. var inViewPort = void 0;
  486. var docEle = document.documentElement;
  487. var docBody = document.body;
  488. if (docEle.getBoundingClientRect) {
  489. w = docEle.clientWidth || docBody.clientWidth;
  490. h = docEle.clientHeight || docBody.clientHeight;
  491. inViewPort = pos.top > h || pos.bottom < 0 || pos.left > w || pos.right < 0;
  492. return inViewPort ? false : true;
  493. }
  494. };
  495. var merge = function merge() {
  496. for (var _len2 = arguments.length, sources = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  497. sources[_key2] = arguments[_key2];
  498. }
  499.  
  500. return Object.assign.apply(Object, [{}].concat(sources));
  501. };
  502. return {
  503. visible: visible,
  504. merge: merge
  505. };
  506. }
  507. }]);
  508.  
  509. return jqLite;
  510. }();
  511.  
  512. var $ = function $() {
  513. var selectors = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
  514. var context = arguments.length <= 1 || arguments[1] === undefined ? document : arguments[1];
  515.  
  516. return new jqLite(selectors, context);
  517. };
  518. $.fn = jqLite.fn;
  519.  
  520. exports.default = $;
  521.  
  522. /***/ },
  523. /* 2 */
  524. /***/ function(module, exports, __webpack_require__) {
  525.  
  526. 'use strict';
  527. var ctx = __webpack_require__(3)
  528. , $export = __webpack_require__(5)
  529. , toObject = __webpack_require__(15)
  530. , call = __webpack_require__(17)
  531. , isArrayIter = __webpack_require__(20)
  532. , toLength = __webpack_require__(24)
  533. , getIterFn = __webpack_require__(26);
  534. $export($export.S + $export.F * !__webpack_require__(29)(function(iter){ Array.from(iter); }), 'Array', {
  535. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  536. from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
  537. var O = toObject(arrayLike)
  538. , C = typeof this == 'function' ? this : Array
  539. , $$ = arguments
  540. , $$len = $$.length
  541. , mapfn = $$len > 1 ? $$[1] : undefined
  542. , mapping = mapfn !== undefined
  543. , index = 0
  544. , iterFn = getIterFn(O)
  545. , length, result, step, iterator;
  546. if(mapping)mapfn = ctx(mapfn, $$len > 2 ? $$[2] : undefined, 2);
  547. // if object isn't iterable or it's array with default iterator - use simple case
  548. if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
  549. for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
  550. result[index] = mapping ? call(iterator, mapfn, [step.value, index], true) : step.value;
  551. }
  552. } else {
  553. length = toLength(O.length);
  554. for(result = new C(length); length > index; index++){
  555. result[index] = mapping ? mapfn(O[index], index) : O[index];
  556. }
  557. }
  558. result.length = index;
  559. return result;
  560. }
  561. });
  562.  
  563.  
  564. /***/ },
  565. /* 3 */
  566. /***/ function(module, exports, __webpack_require__) {
  567.  
  568. // optional / simple context binding
  569. var aFunction = __webpack_require__(4);
  570. module.exports = function(fn, that, length){
  571. aFunction(fn);
  572. if(that === undefined)return fn;
  573. switch(length){
  574. case 1: return function(a){
  575. return fn.call(that, a);
  576. };
  577. case 2: return function(a, b){
  578. return fn.call(that, a, b);
  579. };
  580. case 3: return function(a, b, c){
  581. return fn.call(that, a, b, c);
  582. };
  583. }
  584. return function(/* ...args */){
  585. return fn.apply(that, arguments);
  586. };
  587. };
  588.  
  589. /***/ },
  590. /* 4 */
  591. /***/ function(module, exports) {
  592.  
  593. module.exports = function(it){
  594. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  595. return it;
  596. };
  597.  
  598. /***/ },
  599. /* 5 */
  600. /***/ function(module, exports, __webpack_require__) {
  601.  
  602. var global = __webpack_require__(6)
  603. , core = __webpack_require__(7)
  604. , hide = __webpack_require__(8)
  605. , redefine = __webpack_require__(13)
  606. , ctx = __webpack_require__(3)
  607. , PROTOTYPE = 'prototype';
  608.  
  609. var $export = function(type, name, source){
  610. var IS_FORCED = type & $export.F
  611. , IS_GLOBAL = type & $export.G
  612. , IS_STATIC = type & $export.S
  613. , IS_PROTO = type & $export.P
  614. , IS_BIND = type & $export.B
  615. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]
  616. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  617. , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})
  618. , key, own, out, exp;
  619. if(IS_GLOBAL)source = name;
  620. for(key in source){
  621. // contains in native
  622. own = !IS_FORCED && target && key in target;
  623. // export native or passed
  624. out = (own ? target : source)[key];
  625. // bind timers to global for call from export context
  626. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  627. // extend global
  628. if(target && !own)redefine(target, key, out);
  629. // export
  630. if(exports[key] != out)hide(exports, key, exp);
  631. if(IS_PROTO && expProto[key] != out)expProto[key] = out;
  632. }
  633. };
  634. global.core = core;
  635. // type bitmap
  636. $export.F = 1; // forced
  637. $export.G = 2; // global
  638. $export.S = 4; // static
  639. $export.P = 8; // proto
  640. $export.B = 16; // bind
  641. $export.W = 32; // wrap
  642. module.exports = $export;
  643.  
  644. /***/ },
  645. /* 6 */
  646. /***/ function(module, exports) {
  647.  
  648. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  649. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  650. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  651. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  652.  
  653. /***/ },
  654. /* 7 */
  655. /***/ function(module, exports) {
  656.  
  657. var core = module.exports = {version: '1.2.6'};
  658. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  659.  
  660. /***/ },
  661. /* 8 */
  662. /***/ function(module, exports, __webpack_require__) {
  663.  
  664. var $ = __webpack_require__(9)
  665. , createDesc = __webpack_require__(10);
  666. module.exports = __webpack_require__(11) ? function(object, key, value){
  667. return $.setDesc(object, key, createDesc(1, value));
  668. } : function(object, key, value){
  669. object[key] = value;
  670. return object;
  671. };
  672.  
  673. /***/ },
  674. /* 9 */
  675. /***/ function(module, exports) {
  676.  
  677. var $Object = Object;
  678. module.exports = {
  679. create: $Object.create,
  680. getProto: $Object.getPrototypeOf,
  681. isEnum: {}.propertyIsEnumerable,
  682. getDesc: $Object.getOwnPropertyDescriptor,
  683. setDesc: $Object.defineProperty,
  684. setDescs: $Object.defineProperties,
  685. getKeys: $Object.keys,
  686. getNames: $Object.getOwnPropertyNames,
  687. getSymbols: $Object.getOwnPropertySymbols,
  688. each: [].forEach
  689. };
  690.  
  691. /***/ },
  692. /* 10 */
  693. /***/ function(module, exports) {
  694.  
  695. module.exports = function(bitmap, value){
  696. return {
  697. enumerable : !(bitmap & 1),
  698. configurable: !(bitmap & 2),
  699. writable : !(bitmap & 4),
  700. value : value
  701. };
  702. };
  703.  
  704. /***/ },
  705. /* 11 */
  706. /***/ function(module, exports, __webpack_require__) {
  707.  
  708. // Thank's IE8 for his funny defineProperty
  709. module.exports = !__webpack_require__(12)(function(){
  710. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  711. });
  712.  
  713. /***/ },
  714. /* 12 */
  715. /***/ function(module, exports) {
  716.  
  717. module.exports = function(exec){
  718. try {
  719. return !!exec();
  720. } catch(e){
  721. return true;
  722. }
  723. };
  724.  
  725. /***/ },
  726. /* 13 */
  727. /***/ function(module, exports, __webpack_require__) {
  728.  
  729. // add fake Function#toString
  730. // for correct work wrapped methods / constructors with methods like LoDash isNative
  731. var global = __webpack_require__(6)
  732. , hide = __webpack_require__(8)
  733. , SRC = __webpack_require__(14)('src')
  734. , TO_STRING = 'toString'
  735. , $toString = Function[TO_STRING]
  736. , TPL = ('' + $toString).split(TO_STRING);
  737.  
  738. __webpack_require__(7).inspectSource = function(it){
  739. return $toString.call(it);
  740. };
  741.  
  742. (module.exports = function(O, key, val, safe){
  743. if(typeof val == 'function'){
  744. val.hasOwnProperty(SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  745. val.hasOwnProperty('name') || hide(val, 'name', key);
  746. }
  747. if(O === global){
  748. O[key] = val;
  749. } else {
  750. if(!safe)delete O[key];
  751. hide(O, key, val);
  752. }
  753. })(Function.prototype, TO_STRING, function toString(){
  754. return typeof this == 'function' && this[SRC] || $toString.call(this);
  755. });
  756.  
  757. /***/ },
  758. /* 14 */
  759. /***/ function(module, exports) {
  760.  
  761. var id = 0
  762. , px = Math.random();
  763. module.exports = function(key){
  764. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  765. };
  766.  
  767. /***/ },
  768. /* 15 */
  769. /***/ function(module, exports, __webpack_require__) {
  770.  
  771. // 7.1.13 ToObject(argument)
  772. var defined = __webpack_require__(16);
  773. module.exports = function(it){
  774. return Object(defined(it));
  775. };
  776.  
  777. /***/ },
  778. /* 16 */
  779. /***/ function(module, exports) {
  780.  
  781. // 7.2.1 RequireObjectCoercible(argument)
  782. module.exports = function(it){
  783. if(it == undefined)throw TypeError("Can't call method on " + it);
  784. return it;
  785. };
  786.  
  787. /***/ },
  788. /* 17 */
  789. /***/ function(module, exports, __webpack_require__) {
  790.  
  791. // call something on iterator step with safe closing on error
  792. var anObject = __webpack_require__(18);
  793. module.exports = function(iterator, fn, value, entries){
  794. try {
  795. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  796. // 7.4.6 IteratorClose(iterator, completion)
  797. } catch(e){
  798. var ret = iterator['return'];
  799. if(ret !== undefined)anObject(ret.call(iterator));
  800. throw e;
  801. }
  802. };
  803.  
  804. /***/ },
  805. /* 18 */
  806. /***/ function(module, exports, __webpack_require__) {
  807.  
  808. var isObject = __webpack_require__(19);
  809. module.exports = function(it){
  810. if(!isObject(it))throw TypeError(it + ' is not an object!');
  811. return it;
  812. };
  813.  
  814. /***/ },
  815. /* 19 */
  816. /***/ function(module, exports) {
  817.  
  818. module.exports = function(it){
  819. return typeof it === 'object' ? it !== null : typeof it === 'function';
  820. };
  821.  
  822. /***/ },
  823. /* 20 */
  824. /***/ function(module, exports, __webpack_require__) {
  825.  
  826. // check on default Array iterator
  827. var Iterators = __webpack_require__(21)
  828. , ITERATOR = __webpack_require__(22)('iterator')
  829. , ArrayProto = Array.prototype;
  830.  
  831. module.exports = function(it){
  832. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  833. };
  834.  
  835. /***/ },
  836. /* 21 */
  837. /***/ function(module, exports) {
  838.  
  839. module.exports = {};
  840.  
  841. /***/ },
  842. /* 22 */
  843. /***/ function(module, exports, __webpack_require__) {
  844.  
  845. var store = __webpack_require__(23)('wks')
  846. , uid = __webpack_require__(14)
  847. , Symbol = __webpack_require__(6).Symbol;
  848. module.exports = function(name){
  849. return store[name] || (store[name] =
  850. Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name));
  851. };
  852.  
  853. /***/ },
  854. /* 23 */
  855. /***/ function(module, exports, __webpack_require__) {
  856.  
  857. var global = __webpack_require__(6)
  858. , SHARED = '__core-js_shared__'
  859. , store = global[SHARED] || (global[SHARED] = {});
  860. module.exports = function(key){
  861. return store[key] || (store[key] = {});
  862. };
  863.  
  864. /***/ },
  865. /* 24 */
  866. /***/ function(module, exports, __webpack_require__) {
  867.  
  868. // 7.1.15 ToLength
  869. var toInteger = __webpack_require__(25)
  870. , min = Math.min;
  871. module.exports = function(it){
  872. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  873. };
  874.  
  875. /***/ },
  876. /* 25 */
  877. /***/ function(module, exports) {
  878.  
  879. // 7.1.4 ToInteger
  880. var ceil = Math.ceil
  881. , floor = Math.floor;
  882. module.exports = function(it){
  883. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  884. };
  885.  
  886. /***/ },
  887. /* 26 */
  888. /***/ function(module, exports, __webpack_require__) {
  889.  
  890. var classof = __webpack_require__(27)
  891. , ITERATOR = __webpack_require__(22)('iterator')
  892. , Iterators = __webpack_require__(21);
  893. module.exports = __webpack_require__(7).getIteratorMethod = function(it){
  894. if(it != undefined)return it[ITERATOR]
  895. || it['@@iterator']
  896. || Iterators[classof(it)];
  897. };
  898.  
  899. /***/ },
  900. /* 27 */
  901. /***/ function(module, exports, __webpack_require__) {
  902.  
  903. // getting tag from 19.1.3.6 Object.prototype.toString()
  904. var cof = __webpack_require__(28)
  905. , TAG = __webpack_require__(22)('toStringTag')
  906. // ES3 wrong here
  907. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  908.  
  909. module.exports = function(it){
  910. var O, T, B;
  911. return it === undefined ? 'Undefined' : it === null ? 'Null'
  912. // @@toStringTag case
  913. : typeof (T = (O = Object(it))[TAG]) == 'string' ? T
  914. // builtinTag case
  915. : ARG ? cof(O)
  916. // ES3 arguments fallback
  917. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  918. };
  919.  
  920. /***/ },
  921. /* 28 */
  922. /***/ function(module, exports) {
  923.  
  924. var toString = {}.toString;
  925.  
  926. module.exports = function(it){
  927. return toString.call(it).slice(8, -1);
  928. };
  929.  
  930. /***/ },
  931. /* 29 */
  932. /***/ function(module, exports, __webpack_require__) {
  933.  
  934. var ITERATOR = __webpack_require__(22)('iterator')
  935. , SAFE_CLOSING = false;
  936.  
  937. try {
  938. var riter = [7][ITERATOR]();
  939. riter['return'] = function(){ SAFE_CLOSING = true; };
  940. Array.from(riter, function(){ throw 2; });
  941. } catch(e){ /* empty */ }
  942.  
  943. module.exports = function(exec, skipClosing){
  944. if(!skipClosing && !SAFE_CLOSING)return false;
  945. var safe = false;
  946. try {
  947. var arr = [7]
  948. , iter = arr[ITERATOR]();
  949. iter.next = function(){ safe = true; };
  950. arr[ITERATOR] = function(){ return iter; };
  951. exec(arr);
  952. } catch(e){ /* empty */ }
  953. return safe;
  954. };
  955.  
  956. /***/ },
  957. /* 30 */
  958. /***/ function(module, exports, __webpack_require__) {
  959.  
  960. // 19.1.3.1 Object.assign(target, source)
  961. var $export = __webpack_require__(5);
  962.  
  963. $export($export.S + $export.F, 'Object', {assign: __webpack_require__(31)});
  964.  
  965. /***/ },
  966. /* 31 */
  967. /***/ function(module, exports, __webpack_require__) {
  968.  
  969. // 19.1.2.1 Object.assign(target, source, ...)
  970. var $ = __webpack_require__(9)
  971. , toObject = __webpack_require__(15)
  972. , IObject = __webpack_require__(32);
  973.  
  974. // should work with symbols and should have deterministic property order (V8 bug)
  975. module.exports = __webpack_require__(12)(function(){
  976. var a = Object.assign
  977. , A = {}
  978. , B = {}
  979. , S = Symbol()
  980. , K = 'abcdefghijklmnopqrst';
  981. A[S] = 7;
  982. K.split('').forEach(function(k){ B[k] = k; });
  983. return a({}, A)[S] != 7 || Object.keys(a({}, B)).join('') != K;
  984. }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
  985. var T = toObject(target)
  986. , $$ = arguments
  987. , $$len = $$.length
  988. , index = 1
  989. , getKeys = $.getKeys
  990. , getSymbols = $.getSymbols
  991. , isEnum = $.isEnum;
  992. while($$len > index){
  993. var S = IObject($$[index++])
  994. , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
  995. , length = keys.length
  996. , j = 0
  997. , key;
  998. while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
  999. }
  1000. return T;
  1001. } : Object.assign;
  1002.  
  1003. /***/ },
  1004. /* 32 */
  1005. /***/ function(module, exports, __webpack_require__) {
  1006.  
  1007. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1008. var cof = __webpack_require__(28);
  1009. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
  1010. return cof(it) == 'String' ? it.split('') : Object(it);
  1011. };
  1012.  
  1013. /***/ },
  1014. /* 33 */,
  1015. /* 34 */,
  1016. /* 35 */,
  1017. /* 36 */,
  1018. /* 37 */,
  1019. /* 38 */,
  1020. /* 39 */,
  1021. /* 40 */,
  1022. /* 41 */,
  1023. /* 42 */,
  1024. /* 43 */,
  1025. /* 44 */,
  1026. /* 45 */,
  1027. /* 46 */,
  1028. /* 47 */,
  1029. /* 48 */,
  1030. /* 49 */,
  1031. /* 50 */,
  1032. /* 51 */
  1033. /***/ function(module, exports) {
  1034.  
  1035. "use strict";
  1036.  
  1037. Object.defineProperty(exports, "__esModule", {
  1038. value: true
  1039. });
  1040. /*
  1041. * 频率控制 返回函数连续调用时,fn 执行频率限定为每多少时间执行一次
  1042. * @param fn {function} 需要调用的函数
  1043. * @param delay {number} 延迟时间,单位毫秒
  1044. * @param immediate {bool} 给 immediate参数传递false 绑定的函数先执行,而不是delay后后执行。
  1045. * @return {function}实际调用函数
  1046. */
  1047. var $throttle = function $throttle(fn, delay, immediate, debounce) {
  1048. var curr = +new Date(),
  1049. //当前事件
  1050. last_call = 0,
  1051. last_exec = 0,
  1052. timer = null,
  1053. diff,
  1054. //时间差
  1055. context,
  1056. //上下文
  1057. args,
  1058. exec = function exec() {
  1059. last_exec = curr;
  1060. fn.apply(context, args);
  1061. };
  1062. return function () {
  1063. curr = +new Date();
  1064. context = this, args = arguments, diff = curr - (debounce ? last_call : last_exec) - delay;
  1065. clearTimeout(timer);
  1066. if (debounce) {
  1067. if (immediate) {
  1068. timer = setTimeout(exec, delay);
  1069. } else if (diff >= 0) {
  1070. exec();
  1071. }
  1072. } else {
  1073. if (diff >= 0) {
  1074. exec();
  1075. } else if (immediate) {
  1076. timer = setTimeout(exec, -diff);
  1077. }
  1078. }
  1079. last_call = curr;
  1080. };
  1081. };
  1082.  
  1083. /*
  1084. * 空闲控制 返回函数连续调用时,空闲时间必须大于或等于 delay,fn 才会执行
  1085. * @param fn {function} 要调用的函数
  1086. * @param delay {number} 空闲时间
  1087. * @param immediate {bool} 给 immediate参数传递false 绑定的函数先执行,而不是delay后后执行。
  1088. * @return {function}实际调用函数
  1089. */
  1090.  
  1091. var $debounce = function $debounce(fn, delay, immediate) {
  1092. return $throttle(fn, delay, immediate, true);
  1093. };
  1094.  
  1095. exports.$debounce = $debounce;
  1096. exports.$throttle = $throttle;
  1097.  
  1098. /***/ },
  1099. /* 52 */,
  1100. /* 53 */,
  1101. /* 54 */,
  1102. /* 55 */
  1103. /***/ function(module, exports) {
  1104.  
  1105. "use strict";
  1106.  
  1107. Object.defineProperty(exports, "__esModule", {
  1108. value: true
  1109. });
  1110. var $interval = function $interval(fn, delay) {
  1111. var interval = function interval() {
  1112. fn.call(undefined);
  1113. id = setTimeout(interval, delay);
  1114. };
  1115.  
  1116. var id = setTimeout(interval, delay);
  1117.  
  1118. return function () {
  1119. window.clearTimeout(id);
  1120. };
  1121. };
  1122.  
  1123. $interval.cancel = function (timerFunc) {
  1124. timerFunc();
  1125. };
  1126.  
  1127. exports.default = $interval;
  1128.  
  1129. /***/ },
  1130. /* 56 */,
  1131. /* 57 */,
  1132. /* 58 */
  1133. /***/ function(module, exports, __webpack_require__) {
  1134.  
  1135. 'use strict';
  1136.  
  1137. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1138.  
  1139. var _jqLite = __webpack_require__(1);
  1140.  
  1141. var _jqLite2 = _interopRequireDefault(_jqLite);
  1142.  
  1143. var _config = __webpack_require__(59);
  1144.  
  1145. var _config2 = _interopRequireDefault(_config);
  1146.  
  1147. var _$interval = __webpack_require__(55);
  1148.  
  1149. var _$interval2 = _interopRequireDefault(_$interval);
  1150.  
  1151. var _$debounce = __webpack_require__(51);
  1152.  
  1153. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1154.  
  1155. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1156.  
  1157. var main = function () {
  1158. function main() {
  1159. var agm = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
  1160.  
  1161. _classCallCheck(this, main);
  1162.  
  1163. if (!agm) return this;
  1164.  
  1165. this.ads = (0, _jqLite2.default)(agm);
  1166. }
  1167.  
  1168. _createClass(main, [{
  1169. key: 'filter',
  1170. value: function filter() {
  1171. this.ads.each(function (ele) {
  1172. if (ele.$$filtered) return;
  1173. ele.style.cssText = _config2.default.debug ? '\n border:2px solid red;\n ' : '\n display:none !important;\n visibility:hidden !important;\n width:0 !important;\n height:0 !important;\n overflow:hidden !important;\n ';
  1174. ele.$$filtered = true;
  1175. });
  1176. return this;
  1177. }
  1178. }, {
  1179. key: 'keyword',
  1180. value: function keyword() {
  1181. (0, _jqLite2.default)(_config2.default.keyRules).each(function (aEle) {
  1182. if (aEle.$$filtered) return;
  1183. aEle.removeAttribute('data-swapword');
  1184. aEle.removeAttribute('class');
  1185. aEle.removeAttribute('href');
  1186. aEle.style.cssText = _config2.default.debug ? '\n color:#fff !important;\n background-color:red !important;\n ' : '\n color:inherit !important;\n ';
  1187. aEle.$$filtered = true;
  1188. });
  1189. return this;
  1190. }
  1191. }]);
  1192.  
  1193. return main;
  1194. }();
  1195.  
  1196. var loop = (0, _$interval2.default)(function () {
  1197. new main(_config2.default.adRules).filter().keyword();
  1198. }, 50);
  1199.  
  1200. console.info('贴吧去广告启动...');
  1201.  
  1202. (0, _jqLite2.default)(document).bind('DOMContentLoaded', function () {
  1203.  
  1204. _$interval2.default.cancel(loop);
  1205.  
  1206. // init
  1207. new main(_config2.default.adRules).filter().keyword();
  1208.  
  1209. (0, _jqLite2.default)(document).observe((0, _$debounce.$debounce)(function (target, addList, removeList) {
  1210. if (!addList || !addList.length) return;
  1211. new main(_config2.default.adRules).filter().keyword();
  1212. }, 200));
  1213.  
  1214. (0, _jqLite2.default)(window).bind('scroll', (0, _$debounce.$debounce)(function () {
  1215. new main(_config2.default.adRules).filter().keyword();
  1216. }, 200));
  1217. });
  1218.  
  1219. /***/ },
  1220. /* 59 */
  1221. /***/ function(module, exports) {
  1222.  
  1223. 'use strict';
  1224.  
  1225. Object.defineProperty(exports, "__esModule", {
  1226. value: true
  1227. });
  1228. var CONFIG = {
  1229. // 是否是调试模式
  1230. debug: false,
  1231. adRules: '\n ul#thread_list *[data-daid],\n ul#thread_list>li:not([data-field]):not(.thread_top_list_folder)\n ,\n #j_p_postlist *[data-daid],\n #j_p_postlist *[data-isautoreply]\n ,\n #thread_list>li\n :not([class*="list"])\n :not([data-field])\n ,\n .p_postlist>div\n :not(.p_postlist)\n :not([class*="post"])\n :not([data-field])\n ,\n #aside *[data-daid],\n #aside>div[class*="clearfix"],\n #aside DIV[id$="ad"],\n #aside #encourage_entry,\n .my_app,.j_encourage_entry,\n .right_section>div.u9_aside,\n .right_section>div.clearfix,\n .right_section *[data-daid]\n ,\n #pb_adbanner,#pb_adbanner *[data-daid]\n ,\n #com_u9_head,\n .u9_head,\n div.search_form>div[class*="clearfix"]\n ,\n .firework-wrap\n '.trim().replace(/\n/img, '').replace(/\s{1,}([^a-z\*])/ig, '$1'),
  1232. keyRules: '\n #j_p_postlist a[data-swapword]:not([filted]),\n #j_p_postlist a.ps_cb:not([filted])\n '.trim().replace(/\n/img, '').replace(/\s{1,}([^a-z\*])/ig, '$1')
  1233. };
  1234.  
  1235. exports.default = CONFIG;
  1236.  
  1237. /***/ }
  1238. /******/ ]);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址