Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion swift/ax_text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func getBrowserTabTexts(appScriptName: String) -> [[String: Any]] {
set u to URL of tab i of window w
try
tell tab i of window w
set txt to execute javascript "document.body.innerText.substring(0, 5000)"
set txt to execute javascript "(function(){var c=document.body.cloneNode(true);c.querySelectorAll('img[alt]').forEach(function(i){var a=(i.getAttribute('alt')||'').trim();if(a){i.parentNode.replaceChild(document.createTextNode(' ['+a+'] '),i);}});return c.innerText.substring(0,5000);})()"
end tell
on error
set txt to ""
Expand Down
Loading