From 23d6d8b2b636d29203c2851fc5c9ae5967315da3 Mon Sep 17 00:00:00 2001 From: Bonnie <90729100+13onnie@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:43:21 -0700 Subject: [PATCH] TDW-1646 Add Admiral Script (#122) * add admiral script * TDW-1646 admiral script * remove in script.js --------- Co-authored-by: Bonnie Zheng --- scripts/delayed.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/delayed.js b/scripts/delayed.js index 65ee7fa9..b724abbd 100644 --- a/scripts/delayed.js +++ b/scripts/delayed.js @@ -755,3 +755,27 @@ const hasWeFevo = document.querySelector('a.we-fevo-btn'); if (hasWeFevo) { injectWeFevoScript(); } + +/** + * Loads Admiral script + */ +function loadAdmiral() { + const fetchScript = async () => { + try { + const response = await fetch( + 'https://orchestrator-config-uat.pgatour.com/revops/admirial', + ); + const content = await response.text(); + const script = document.createElement('script'); + script.type = 'text/javascript'; + script.innerHTML = content; + script.id = 'admiral'; + document.head.appendChild(script); + } catch (error) { + throw new Error('Error loading Admiral script: ', error); + } + }; + fetchScript(); +} + +loadAdmiral();