diff --git a/manifest.json b/manifest.json index 78407e634..743a413eb 100644 --- a/manifest.json +++ b/manifest.json @@ -1818,6 +1818,10 @@ { "js": ["plugins/unlimphotos.js"], "matches": ["*://*.unlimphotos.com/*"] + }, + { + "js": ["plugins/eksisozluk.js"], + "matches": ["*://*.eksisozluk.com/*"] } ] } diff --git a/plugins/eksisozluk.js b/plugins/eksisozluk.js new file mode 100644 index 000000000..8ba8bcc33 --- /dev/null +++ b/plugins/eksisozluk.js @@ -0,0 +1,31 @@ +var hoverZoomPlugins = hoverZoomPlugins || []; +hoverZoomPlugins.push( { + name: 'eksisozluk', + version: '1.0', + prepareImgLinks: function(callback) { + var res = []; + + // page hosting link to img: https://eksisozluk.com/entry/140581590 + // link to img: https://soz.lk/i/3jadcz74 + // fullsize img: https://cdn.eksisozluk.com/2022/7/28/3/3jadcz74.jpg + $('a[href*="/soz.lk/"]:not(.hoverZoomMouseover)').addClass('hoverZoomMouseover').one('mouseover', function() { + + var link = undefined; + var href = undefined; + + href = this.href; + link = $(this); + + // clean previous result + link.data().hoverZoomSrc = []; + hoverZoom.prepareFromDocument($(this), this.href, function(doc) { + + let img = doc.querySelector('img'); + if (img) return img.src; + + }, false); // get source sync + }); + + callback($(res), this.name); + } +});