GreaseMonkey脚本重写图像链接[重复]

||                                                                                                                   这个问题已经在这里有了答案:                                                      
已邀请:
        您必须遍历所有
<img>
标记,然后在
src
属性中将
thumbnail
替换为
large
// This fetches all of the <img> tags and stores them in \"tags\".
var tags = document.getElementsByTagName(\'img\');

// This loops over all of the <img> tags.
for (var i = 0; i < tags.length; i++) {

  // This replaces the src attribute of the tag with the modified one
  tags[i].src = tags[i].src.replace(\'thumbnail\', \'large\');
}
希望这段代码行得通。我使用的是基本的
replace()
,因此,如果您想尝试使用正则表达式,我认为它也应该适用。     

要回复问题请先登录注册