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. Mouse button and use of CTRL key can be configured in the script.

2019-05-13 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        Bing Image Direct Link Patch
// @namespace   BingImageDirectLinkPatch
// @version     1.1.3
// @license     AGPLv3
// @author      jcunews
// @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. Mouse button and use of CTRL key can be configured in the script.
// @include     https://www.bing.com/images/search*
// @grant       none
// ==/UserScript==

(() => {
  //===== CONFIGURATION BEGIN

  var mouseButton = 0;    //0=Left, 1=Right, 2=Middle
  var useCtrlKey  = true; //true=CTRL key is required. i.e. CTRL+MouseButton

  //Use of SHIFT key will always open the image in a new tab.

  //===== CONFIGURATION END

  //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 ===mouseButton) && (!useCtrlKey || 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);
})();