您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Выделяет заголовки топиков жёлтым цветом определённых авторов
当前为
// ==UserScript== // @author Lightwave // @name Habrahabr topics highlighter // @description Выделяет заголовки топиков жёлтым цветом определённых авторов // @version 2.0 // @include http://habrahabr.ru/* // @include https://habrahabr.ru/* // @include http://geektimes.ru/* // @include https://geektimes.ru/* // @include http://megamozg.ru/* // @include https://megamozg.ru/* // @grant none // @namespace https://greasyfork.org/users/9366 // ==/UserScript== (function () { var posts = document.querySelectorAll('div.post'); var authors = [ 'alizar', 'andorro', 'marks', 'SLY_G', 'FakeFactFelis', 'ivansychev', 'ilya42', 'jeston', 'Shapelez', 'jasiejames' ]; var dailyPosts = document.querySelectorAll('.daily_best_posts > .posts_list > .post_item'); for (var i = 0; i < posts.length; i++) { var authorName = posts[i].querySelector('div.author a').innerHTML; if (authors.indexOf(authorName) != -1) { var postName = posts[i].querySelector('.post_title').textContent; posts[i].querySelector('.post_title').textContent = '(' + authorName + ') ' + postName; posts[i].querySelector('.post_title').style.backgroundColor = '#ff0'; } } for (var j = 0; j < dailyPosts.length; j++) { var dailyPostName = dailyPosts[j].querySelector('.post_name').textContent; var baseUri = dailyPosts[j].querySelector('a').baseURI; var dpUrl = dailyPosts[j].querySelector('a').href; if (baseUri.indexOf('https') != -1) { dpUrl = dpUrl.replace('http', 'https'); } var httpReq = new XMLHttpRequest(); httpReq.open('GET', dpUrl, false); httpReq.send(null); var dummy = document.createElement('div'); dummy.innerHTML = httpReq.responseText; var dailyPostAuthorName = dummy.querySelector('div.author a').innerHTML; if (authors.indexOf(dailyPostAuthorName) != - 1) { dailyPosts[j].querySelector('.post_name').textContent = '(' + dailyPostAuthorName + ') ' + dailyPostName; dailyPosts[j].querySelector('.post_name').style.backgroundColor = '#ffff00'; } } }) ();