我无法让此脚本在Chrome中运行,它在Firefox中运行良好。它的作用是在Tweetdeck的每一列的顶部放置一个“清除”按钮。它显示按钮但单击时没有任何反应。
// ==UserScript==
// @name TweetDeck Clear Button
// @namespace http://dvdbng.com
// @description Adds a clear column button directly accesible
// @include https://web.tweetdeck.com/*
// ==/UserScript==
var $ = unsafeWindow.jQuery;
//Places the "clean" button on top of header
unsafeWindow.TD_mustaches["column/column_header.mustache"] = unsafeWindow.TD_mustaches["column/column_header.mustache"].replace('<div class="options-nav">','<div class="options-nav"><a class="GS_clean">clean</a>');
$(document.body).delegate(".GS_clean","click",function(){
//This does navigation to get to the "Clear Column" button
$(this).parents(".column")
.find("a[data-action=options]").click().end()
.find("input[data-action=clear]").click().end()
.find("a[data-action=options]").click()
});