Skip to content

Instantly share code, notes, and snippets.

View Oscar-Arias2001's full-sized avatar

Oscar Arias Oscar-Arias2001

View GitHub Profile
@Oscar-Arias2001
Oscar-Arias2001 / imageFormatIdentifier.js
Last active December 17, 2025 19:04
This code detects which image formats the browser supports and adds classes to the <html> based on the result.
"use strict";
(function (document) {
let checkCount = 0,
formatFound = false;
const setHTMLClass = (height, className) => {
checkCount++;
if (height == 2) {
formatFound = true;