fiag
管理员
管理员
  • UID1188
  • 注册日期2004-12-21
  • 最后登录2025-08-20
  • 发帖数4681
  • 经验686枚
  • 威望0点
  • 贡献值402点
  • 好评度51点
阅读:3157回复:4

[分享]GreaseMonkey 脚本- 抹掉译言网文章中的Tag链接

楼主#
更多 发布于:2008-08-20 15:03
文章正文中的Tag链接,对我来说有点华而不实,看起来有点不爽。
所以把它们干掉了。

这样把正文复制到邮件也会干净一些。
代码如下。

// ==UserScript==
// @name           YeeYan Tag Cleaner
// @author         fiag
// @namespace      https://www.firefox.net.cn/forum/
// @include        http://www.yeeyan.com/*
// @include        http://feed.yeeyan.com/*
// ==/UserScript==

var article_body = document.getElementById('article_body');
if(article_body) {
	var results;
	results = document.evaluate("//a[@class='bodytag']/em", article_body, 
		null,	XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	for (var j = 0; j < results.snapshotLength; j++) {
		var e = results.snapshotItem(j);
		var text = e.textContent;
		var txtNode = document.createTextNode(text);
		e.parentNode.parentNode.insertBefore(txtNode, e.parentNode.nextSibling);
		e.parentNode.parentNode.removeChild(e.parentNode);
	}
}
Endif
火狐狸
火狐狸
  • UID5035
  • 注册日期2005-04-12
  • 最后登录2010-12-28
  • 发帖数292
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
1楼#
发布于:2008-08-20 15:03
挺有用
顺便问问有没有这样的脚本:
Google或baidu搜索之后用网页快照会加亮关键字
想把加亮去掉
fiag
管理员
管理员
  • UID1188
  • 注册日期2004-12-21
  • 最后登录2025-08-20
  • 发帖数4681
  • 经验686枚
  • 威望0点
  • 贡献值402点
  • 好评度51点
2楼#
发布于:2008-08-20 15:03
Endif:挺有用
顺便问问有没有这样的脚本:
Google或baidu搜索之后用网页快照会加亮关键字
想把加亮去掉
回到原帖


很容易,写了一个百度快照的

兼容 Google.cn  快照


// ==UserScript==
// @name          Cache Highlight Remover
// @namespace      https://www.firefox.net.cn/forum/
// @include        http://cache.baidu.com/*
// @include        http://203.208.35.101/*
// ==/UserScript==

var allItems, thisItem;
allItems = document.evaluate(
    '//b[@style]',
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
for (var i = 0; i < allItems.snapshotLength; i++) {
    thisItem = allItems.snapshotItem(i);
    // 使用 thisItem
    var style = thisItem.getAttribute('style');
    if(style == 'color: black; background-color: rgb(255, 255, 102);') {
	var text = thisItem.textContent;
	var txtNode = document.createTextNode(text); 
	thisItem.parentNode.insertBefore(txtNode, thisItem.nextSibling);
	thisItem.parentNode.removeChild(thisItem);
    }
}
Endif
火狐狸
火狐狸
  • UID5035
  • 注册日期2005-04-12
  • 最后登录2010-12-28
  • 发帖数292
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2008-08-20 15:03
谢谢楼上
不过只能清除黄色标记,无法清除兰色标记(比方搜索”施瓦辛格“,”施瓦“上的黄色没有了,”辛格“上的兰色还在。
蓝色的吉他
非常火狐
非常火狐
  • UID11286
  • 注册日期2006-01-24
  • 最后登录2017-03-27
  • 发帖数647
  • 经验17枚
  • 威望0点
  • 贡献值8点
  • 好评度0点
4楼#
发布于:2008-08-20 15:03
能写个脚本实现类似CUSTOM GOOGLE里的在GOOGLE搜索时可点击百度搜索当前搜索的关键字
最好能在百度里也点击GOOGLE搜索
We may be human,but we're still animals.
游客

返回顶部