Handle children of added nodes as well
ClosedPublic

Authored by fvogt on May 20 2018, 2:11 PM.

Details

Summary

Element trees can be added as well, but without this, only the root element was
handled.

Test Plan

Videos on twitter get registered now.

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
fvogt created this revision.May 20 2018, 2:11 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 20 2018, 2:11 PM
fvogt requested review of this revision.May 20 2018, 2:11 PM

Sweet!

I think it used to have this but it caused trouble due to DOM traversal with complex sites. The old code walked the entire DOM every time whereas you just query the node that changed, so shouldn't have that big of an impact as the old one did.

@lbeltrame Can you check whether this causes trouble with the massive table you had issues with?

broulik added inline comments.May 21 2018, 12:48 PM
extension/content-script.js
357–361

if (typeof node.querySelectorAll !== "function")
also coding style, add braces

What's the easiest way to test this? I might just patch the package and see what happens.

abetts added a subscriber: abetts.May 21 2018, 2:18 PM
abetts removed a subscriber: abetts.
fvogt updated this revision to Diff 34606.May 21 2018, 7:47 PM

We've officially arrived in callback hell.

fvogt added a comment.May 21 2018, 7:49 PM

What's the easiest way to test this? I might just patch the package and see what happens.

git clone the repo and load an unpacked extension at the /extension (deactivate/uninstall the other version first).

You can't really patch a .crx.

broulik accepted this revision.May 22 2018, 7:55 AM
This revision is now accepted and ready to land.May 22 2018, 7:55 AM
This revision was automatically updated to reflect the committed changes.