您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes ad leftovers on Men's Health's websites. Best used with uBlock Origin.
// ==UserScript== // @name Men's Health Fixer // @namespace http://skoshy.com // @version 0.4 // @description Removes ad leftovers on Men's Health's websites. Best used with uBlock Origin. // @author Stefan Koshy // @match http*://*.menshealth.com/* // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; var id = 'mensHealthFixer'; var cleanupCSS = ` #header.leader, #header.scrolling { top: 0 !important; } .pinit-btn-container { display: none !important; } .pinit:hover img { opacity: 1 !important; } .right_rail { display: none !important; } .article-section, .slideshow-section { width: 100% !important; } /* Fix huge images in articles with full-width */ .slideshow .bx-wrapper img { width: auto !important; margin: 0 auto; max-width: 100%; max-height: 500px; } `; addGlobalStyle(cleanupCSS, id+"CleanupCSS"); // Fixes slideshows so that the ad doesn't show and it automatically goes to the next slide (function() { var nextSlideFromAdButton = document.querySelector('.ad-prev'); nextSlideFromAdButton.href = 'javascript:'; setInterval(function() { eventFire(nextSlideFromAdButton, 'click'); }, 1000); })(); // ***************** // Utility Functions // ***************** function addGlobalStyle(css, cssID) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.id = cssID; style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } // Used from http://stackoverflow.com/questions/2705583/simulate-click-javascript function eventFire(el, etype){ if (el.fireEvent) { (el.fireEvent('on' + etype)); } else { var evObj = document.createEvent('Events'); evObj.initEvent(etype, true, false); el.dispatchEvent(evObj); } }