PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 4.2.13
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v4.2.13
4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 3.12.1 All 134 releases
optimole-wp / assets / js / optimizer.js

optimizer.js in Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization 4.2.13, at assets/js/optimizer.js

42 lines 1021 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Optimole Image Optimizer - Main Entry Point
3 *
4 * Detects images with data-opt-id attribute that are above the fold
5 * and logs them along with the current device type
6 *
7 * This file imports and orchestrates all the modular components:
8 * - Logger utilities
9 * - Storage management
10 * - Device detection
11 * - API communication
12 * - DOM utilities
13 * - Background image handling
14 * - LCP detection
15 * - Image detection and analysis
16 */
17
18 // Import all modules
19 import { optmlMain } from './modules/main.js';
20
21 (function() {
22 'use strict';
23
24 /**
25 * Initialize the image detection process
26 */
27 function initializeOptimizer() {
28 if (optmlMain && optmlMain.runProfiling) {
29 optmlMain.runProfiling();
30 } else {
31 console.error('[Optimole] Main module not available');
32 }
33 }
34
35 // Ensure the DOM is loaded before running detection
36 if (document.readyState === 'loading') {
37 document.addEventListener('DOMContentLoaded', initializeOptimizer);
38 } else {
39 initializeOptimizer();
40 }
41 })();
42