From 9bf8bf2e2c9e1f926dc5d3bfc884df3d42976fe6 Mon Sep 17 00:00:00 2001 From: GrosPoulet Date: Sun, 28 Aug 2022 16:24:52 +0200 Subject: [PATCH] New plug-in for: 2gis.com --- manifest.json | 16 ++++++++++++++++ plugins/2gis.js | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 plugins/2gis.js diff --git a/manifest.json b/manifest.json index 24bdd7618..1bed1f6c2 100644 --- a/manifest.json +++ b/manifest.json @@ -1836,6 +1836,22 @@ { "js": ["plugins/tnaflix.js"], "matches": ["*://*.tnaflix.com/*"] + }, + { + "js": ["plugins/2gis.js"], + "matches": ["*://*.2gis.com/*", + "*://*.2gis.ae/*", + "*://*.2gis.az/*", + "*://*.2gis.cl/*", + "*://*.2gis.cz/*", + "*://*.2gis.kg/*", + "*://*.2gis.kz/*", + "*://*.2gis.ru/*", + "*://*.2gis.uz/*", + "*://*.urbi-bh.com/*", + "*://*.urbi-kw.com/*", + "*://*.urbi-qa.com/*", + "*://*.urbi-sa.com/*"] } ] } diff --git a/plugins/2gis.js b/plugins/2gis.js new file mode 100644 index 000000000..bcc2ea180 --- /dev/null +++ b/plugins/2gis.js @@ -0,0 +1,20 @@ +var hoverZoomPlugins = hoverZoomPlugins || []; +hoverZoomPlugins.push({ + name:'2gis', + version:'1.0', + prepareImgLinks:function (callback) { + + var res = []; + + // page with samples: https://2gis.ru/orenburg?m=55.128792%2C51.760619%2F13.23&layer=photos + // thumbnail: https://i.photo.2gis.com/images/branch/48/6755399466628955_a374_128x128.jpg + // fullsize: https://i.photo.2gis.com/images/branch/48/6755399466628955_a374.jpg + hoverZoom.urlReplace(res, + 'img[src], [style*="url"]', + /_\d+x\d+/, + '' + ); + + callback($(res), this.name); + } +}); \ No newline at end of file