Bing Image Direct Link Patch

Make CTRL+Click on image thumbnail go directly to the image in a Bing Image search result. Use CTRL+SHIFT+Click to open image in a new tab.

当前为 2017-09-01 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Bing Image Direct Link Patch
// @namespace   BingImageDirectLinkPatch
// @description Make CTRL+Click on image thumbnail go directly to the image in a Bing Image search result. Use CTRL+SHIFT+Click to open image in a new tab.
// @author      jcunews
// @include     https://www.bing.com/images/search*
// @version     1.0.1
// @grant       none
// ==/UserScript==

//add direct image URL to the image bottom panel
document.addEventListener("click", function(ev) {
  var base, ele = ev.target, url, link, z;
  if (!ev.button && ev.ctrlKey && ele.classList.contains("mimg")) try {
    base = ele.parentNode.parentNode.parentNode.parentNode;
    url = JSON.parse(base.querySelector(".iusc").getAttribute("m")).murl;
    if (ev.shiftKey) {
      open(url, "bidlp" + (new Date()).valueOf());
    } else {
      location.href = url;
    }
    ev.preventDefault();
    ev.stopPropagation();
    ev.stopImmediatePropagation();
  } catch (z) {}
}, true);