您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name DailyRush V5 Message notifications // @namespace drNotify // @version 0.1 // @description try to take over the world! // @author johnnie johansen // @match https://www.dailyrush.dk/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.js // @grant none // ==/UserScript== // http://www.greasespot.net/2012/08/greasemonkey-10-jquery-broken-with.html this.$ = this.jQuery = jQuery.noConflict(true); // GM/jQ v1.0 quickfix let userLoggedInSelector = '.td_user_logd_in'; $(document).ready(function(){ dailyrushNotifications(); function cl(string){ console.log(string); } function dailyrushNotifications() { let userLoggedIn = $(userLoggedInSelector).attr('href'); if (!userLoggedIn) return; userLoggedIn += "/messages"; $.get(userLoggedIn, function( data ) { let anyNewMessages = $(data).find('#user-messages span').html(); if(!anyNewMessages) return; let currentHtml = $(userLoggedInSelector).html(); $(userLoggedInSelector).html(currentHtml + '<span style="margin-left:6px;color:#fff;background:#f0f;border-radius:6px;padding:3px 6px;font-size:10px;font-family:verdana;">' + anyNewMessages + '</span>'); }); } });