Skip to content

Commit

Permalink
Remove URL check for WebArena tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jardinetsouffleton committed Mar 3, 2025
1 parent 50d497d commit ae677da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions browsergym/webarena/src/browsergym/webarena/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ def validate(
) -> Tuple[float, bool, str, dict]:

# safeguard: check that all open tabs are either blank or within the list of WebArena URLs
authorized_locations = ["newtab", ""] + [
urllib.parse.urlparse(url).netloc
for url in [*self.webarena_instance.urls.values(), self.webarena_instance.home_url]
]
for open_page in page.context.pages:
page_location = urllib.parse.urlparse(open_page.url).netloc
if not page_location in authorized_locations:
return 0, True, "", {"error": "Unauthorized url, terminating task"}
# authorized_locations = ["newtab", ""] + [
# urllib.parse.urlparse(url).netloc
# for url in [*self.webarena_instance.urls.values(), self.webarena_instance.home_url]
# ]
# for open_page in page.context.pages:
# page_location = urllib.parse.urlparse(open_page.url).netloc
# if not page_location in authorized_locations:
# return 0, True, "", {"error": "Unauthorized url, terminating task"}

# import webarena dynamically
from webarena.browser_env.actions import ActionTypes
Expand Down

0 comments on commit ae677da

Please sign in to comment.