Skip to content

Commit

Permalink
Grab class names from body and head
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Sep 26, 2023
1 parent 54599b3 commit 41f6da7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion css_browserhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, browserHook, sessionId : str, targetInfo : dict):
asyncio.create_task(self._init())

async def _init(self):
res = await self.evaluate_js("(function(){ return {\"title\": document.title, \"classes\": Array.from(document.documentElement.classList)} })()")
res = await self.evaluate_js("(function(){ return {\"title\": document.title, \"classes\": Array.from(document.documentElement.classList).concat(Array.from(document.body.classList)).concat(Array.from(document.head.classList))} })()")

if res != None:
self.title = res["title"]
Expand Down

0 comments on commit 41f6da7

Please sign in to comment.