ameblo image opener

Alt+click to open full-size ameblo image in new tab.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @author         CTQY
// @name           ameblo image opener
// @name:ja        アメブロ画像ダウンロード
// @namespace      ct.qy
// @homepageURL    https://greasyfork.org/scripts/402229-ameblo-image-opener
// @version        1.0.2
// @include        *ameblo.jp/*
// @description    Alt+click to open full-size ameblo image in new tab.
// @description:ja Alt+クリックでアメブロのフルサイズの画像を新しいタブで開きます。
// @icon           https://ameblo.jp/favicon.ico
// @require        https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// ==/UserScript==

var timestamp = 0;

(function($){

$(document).on('click', '.userImageLink, article, img', function(e, a) {
  if (!e) e = window.event;
  if (!e.altKey) return;
  e.preventDefault();
  if (e.timeStamp <= timestamp) return;
  timestamp = e.timeStamp;
  var target = $(e.currentTarget);
  var img = target.is('img') ? target : target.find('img').last();
  var url = img.attr('src');
  if (url) {
    window.open(url.split('?')[0], '_blank');
  }
});

})(jQuery);