巴哈SauceNAO圖搜按鈕

巴哈姆特SauceNAO圖搜按鈕

目前為 2018-03-19 提交的版本,檢視 最新版本

// ==UserScript==
// @name 巴哈SauceNAO圖搜按鈕
// @description 巴哈姆特SauceNAO圖搜按鈕
// @author mogeko12345
// @version 1.0.1
// @namespace https://home.gamer.com.tw/Mogeko12345
// @match https://forum.gamer.com.tw/C.php*
// @grant none
// ==/UserScript==

(function(){
  function search(){
    var article = document.getElementsByClassName("c-article FM-P2")[this.value];
    var img = article.getElementsByClassName("photoswipe-image");
    if(img.length === 0){
      img = article.getElementsByClassName("loadpic photoswipe-image-shrink");
    }
    for(var ii = 0; ii < img.length; ii++){
     window.open("http://saucenao.com/search.php?db=999&url=" + img[ii].href, "_blank"); 
    }
  }
  var header = document.getElementsByClassName("c-post__header__tools");
  for(var i = 0; i < header.length; i++){
    var button = document.createElement("button");
    var inner = document.createElement("i");
    inner.className = "icon-font";
    inner.appendChild(document.createTextNode("搜"));
    button.className = "ef-btn";
    button.value = i;
    button.addEventListener("click", search, false);
    button.appendChild(inner);
    header[i].appendChild(button);
  }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址