diff --git a/assets/manifest.json b/assets/manifest.json index d11975c..921aef5 100644 --- a/assets/manifest.json +++ b/assets/manifest.json @@ -2,7 +2,7 @@ "name": "Offie - Airbnb Wifi Reviews", "description": "View Wifi and workspace info from the Airbnb search results page.", "manifest_version": 3, - "version": "0.0.12", + "version": "0.0.13", "icons": { "16": "img/offie-logo-16.png", "48": "img/offie-logo-48.png", diff --git a/src/content/utils/dom.ts b/src/content/utils/dom.ts index b34924a..5d123d1 100644 --- a/src/content/utils/dom.ts +++ b/src/content/utils/dom.ts @@ -106,16 +106,24 @@ export const insertBeforeBadge = ( listingDetails: HTMLElement, offieNode: HTMLElement ): void => { - const badgeContainer = listingDetails.children[ + const badgeParentContainer = listingDetails.children[ listingDetails.childElementCount - 2 ] as HTMLElement; - if (!badgeContainer) { + if (!badgeParentContainer) { throw new Error( `Failed to find the 'badgeContainer' var in ${insertBeforeBadge.name}` ); } + const badgeContainer = badgeParentContainer.children[0] as HTMLElement; + + if (!badgeParentContainer) { + throw new Error( + `Failed to find the 'badgeParentContainer' var in ${insertBeforeBadge.name}` + ); + } + /** * Heuristic: `Rare find` badge has a diamond svg */