Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added icons/optimole.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions library/libraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
}
};