Some web updates.

This commit is contained in:
Storm Dragon
2026-05-24 03:47:15 -04:00
parent cb553d3031
commit edc195c46b
3 changed files with 136 additions and 3 deletions
+16 -2
View File
@@ -2276,7 +2276,10 @@ class Script(default.Script):
tokens = ["WEB: Dumping cache and context: source is focus",
cthulhu_state.locusOfFocus]
debug.printTokens(debug.LEVEL_INFO, tokens, True)
self.utilities.dumpCache(document, preserveContext=False)
self.utilities.dumpCache(
document,
preserveContext=not AXObject.is_dead(event.source),
)
elif AXObject.is_dead(cthulhu_state.locusOfFocus):
msg = "WEB: Dumping cache: dead focus"
debug.printMessage(debug.LEVEL_INFO, msg, True)
@@ -2389,7 +2392,10 @@ class Script(default.Script):
tokens = ["WEB: Dumping cache and context: source is focus",
cthulhu_state.locusOfFocus]
debug.printTokens(debug.LEVEL_INFO, tokens, True)
self.utilities.dumpCache(document, preserveContext=False)
self.utilities.dumpCache(
document,
preserveContext=not AXObject.is_dead(event.source),
)
elif AXObject.is_dead(cthulhu_state.locusOfFocus):
msg = "WEB: Dumping cache: dead focus"
debug.printMessage(debug.LEVEL_INFO, msg, True)
@@ -2594,6 +2600,14 @@ class Script(default.Script):
else:
msg = "WEB: Search for caret context failed"
debug.printMessage(debug.LEVEL_INFO, msg, True)
if AXUtilities.is_focusable(event.source) \
and AXUtilities.is_focused(event.source) \
and self.utilities.inDocumentContent(event.source):
msg = "WEB: Falling back to focused event source as caret context"
debug.printMessage(debug.LEVEL_INFO, msg, True)
cthulhu.setLocusOfFocus(event, event.source, False)
self.utilities.setCaretContext(event.source, 0)
obj, offset = event.source, 0
if self._lastCommandWasCaretNav:
msg = "WEB: Event ignored: Last command was caret nav"
+2 -1
View File
@@ -5050,7 +5050,8 @@ class Utilities(script_utilities.Utilities):
debug.printMessage(debug.LEVEL_INFO, msg, True)
return False
if not AXObject.is_dead(cthulhu_state.locusOfFocus):
if not AXObject.is_dead(cthulhu_state.locusOfFocus) \
and not self.isSameObject(replicant, cthulhu_state.locusOfFocus, True, True):
tokens = ["WEB: Not event from context replicant. locusOfFocus",
cthulhu_state.locusOfFocus, "is not dead."]
debug.printTokens(debug.LEVEL_INFO, tokens, True)