Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
fix for trusted types (#444)
ishmeals96a35a8f1e08
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.jsindex 8c9f4b783..1c13e441b 100644--- a/skyvern/webeye/scraper/domUtils.js+++ b/skyvern/webeye/scraper/domUtils.js@@ -1146,7 +1146,19 @@ function createHintMarkersForGroups(groups) {for (let i = 0; i < hintMarkers.length; i++) {const hintMarker = hintMarkers[i];hintMarker.hintString = hintStrings[i];- hintMarker.element.innerHTML = hintMarker.hintString.toUpperCase();+ try {+ hintMarker.element.innerHTML = hintMarker.hintString.toUpperCase();+ } catch (e) {+ // Ensure trustedTypes is available+ if (typeof trustedTypes !== 'undefined') {+ const escapeHTMLPolicy = trustedTypes.createPolicy("default", {+ createHTML: (string) => string,+ });+ hintMarker.element.innerHTML = escapeHTMLPolicy.createHTML(hintMarker.hintString.toUpperCase());+ } else {+ console.error("trustedTypes is not supported in this environment.");+ }+ }}return hintMarkers;