diff --git a/index.html b/index.html
index 3a7d390..d67abbe 100644
--- a/index.html
+++ b/index.html
@@ -15,7 +15,8 @@
-
+
+
diff --git a/js/isValidTag.js b/js/isValidTag.js
index 75ec52d..4da2bec 100644
--- a/js/isValidTag.js
+++ b/js/isValidTag.js
@@ -1,8 +1,30 @@
import htmlTags from '../json/html-tags.json' with { type: 'json' };
import htmlVoidTags from '../json/html-tags-void.json' with { type: 'json' };
-export const unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
+const browser = bowser.getParser(window.navigator.userAgent).getBrowser();
+
+export let unifiedTagCollection = [];
+
+if (browser === "Chrome") {
+ unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
+} else if (browser === "Firefox") {
+ const htmlTags = await fetchMultipleJsonUrls([
+ `${window.location.origin}/json/html-tags.json`,
+ `${window.location.origin}/json/html-tags-void.json`
+ ]);
+
+ unifiedTagCollection = [...htmlTags];
+} else {
+ unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
+}
export default function isValidTag(tag) {
return unifiedTagCollection.includes(tag);
+}
+
+/** @returns {Promise} */
+async function fetchMultipleJsonUrls(urls) {
+ const responses = await Promise.all(urls.map(url => fetch(url)));
+ const jsonArrays = await Promise.all(responses.map(response => response.json()));
+ return jsonArrays.flat();
}
\ No newline at end of file