diff --git a/icons/optimole.png b/icons/optimole.png new file mode 100644 index 0000000..f6d1c33 Binary files /dev/null and b/icons/optimole.png differ diff --git a/library/libraries.js b/library/libraries.js index d962581..7ffd277 100644 --- a/library/libraries.js +++ b/library/libraries.js @@ -2143,5 +2143,21 @@ var d41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests = { } return false; } + }, + 'Optimole':{ + id:'optimole', + icon:'optimole', + url: 'https://optimole.com/', + npm: null, + test: function (win) { + const hasOptimoleData = win.optimoleData === Object( win.optimoleData ) && ( typeof win.optimoleData.key !== 'undefined' || typeof win.optimoleData.maxWidth !== 'undefined' ); + const hasOptimoleImg = !!document.querySelector('img[data-opt-src]'); + + if (!hasOptimoleData && !hasOptimoleImg) return false; + + const generatorMeta = document.querySelector('meta[name=generator][content^="Optimole"]'); + const version = generatorMeta ? generatorMeta.getAttribute("content").replace(/^\w+\s/,'') : UNKNOWN_VERSION; + return { version }; + } } };