3

When I hover over a link with the mouse I would like to know if the link will open in a new tab (has a _blank html attribute).

Is there a Chrome extension that implements this?

  • Thanks! If it's going to be in the Chrome Web Store please let me know. – Eyal Levin Mar 31 '15 at 7:42
2

I've made an extension to do this.

You can install in from my Github repo - just download the .crx file and drag it onto chrome://extensions.

You can change the cursor icon by going to chrome://extensions, finding this extension, clicking Options and choosing it from there


Alternatively, you can use this bookmarklet (generated via Ben Alman's Jquery Bookmarklet Generator):

javascript: (function (e, a, g, h, f, c, b, d) {
    if (!(f = e.jQuery) || g > f.fn.jquery || h(f)) {
        c = a.createElement("script");
        c.type = "text/javascript";
        c.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + g + "/jquery.min.js";
        c.onload = c.onreadystatechange = function () {
            if (!b && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
                h((f = e.jQuery).noConflict(1), b = 1);
                f(c).remove()
            }
        };
        a.documentElement.childNodes[0].appendChild(c)
    }
})(window, document, "1.3.2", function ($, L) {
    $('a').each(function () {
        if ($(this).attr('target') == '_blank') {
            $(this).hover(function () {
                $(this).css('cursor', 'crosshair');
            }, function () {
                $(this).css('cursor', 'auto');
            });
        }
    });
});

(change the crosshair to whichever cursor you prefer - you can see all the cursor's on W3Schools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.