feat(hog): fix elements matching
Problem
It started from this:
This exposes two problems:
- we don't have the new materialized
elements_chain_*columns in Hog globals - we can't run functions that use lambdas, like
arrayExists
Changes
- Add the 4 new fields
elements_chain_href,elements_chain_texts,elements_chain_ids,elements_chain_elementsinto Hog filter matching. They're added lazily (calculated only when accessed). This wouldn't work with async functions (all lazy vars would get evaluated when serializing), but seems to work just fine for sync filter matching.
Future work
-
I tried using
hasinstead ofarrayExistsfor exact element text matching. This would make the simple "element text equals X" filter work, while not fixing contains/regex matches. Unfortunately this would behave differently whether the filter was added via an action or directly, and fixing it would introduce too many hacks. -
We might want to add
elements_chainor all its variants into the Hog functions globals as well. elements_chain is a field in the events table, so I don't see a reason to pass it via properties. Best to stick to the documented schema? -
I'll make
arrayExistswork with lambdas next. It might be easier than expected.
How did you test this code?
WIP
Size Change: 0 B
Total Size: 1.12 MB
ℹ️ View Unchanged
| Filename | Size |
|---|---|
frontend/dist/toolbar.js |
1.12 MB |
📸 UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (wasn't pushed!) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.
Ready for a re-review