jesus2099 / konami-command

power‐ups for various web sites
117 stars 25 forks source link

Stats: All time (only complete months) #771

Open jesus2099 opened 11 months ago

jesus2099 commented 11 months ago

Blocked by:

Shadow DOM manipulation is currently not possible: https://github.com/violentmonkey/violentmonkey/issues/1852

jesus2099 commented 11 months ago

Wow, @tophf was right! It is possible to manipulate shadow DOM, it's just that this website has some additional funny stuff going on!

I found a random page with #shadow-root (open): https://apearce.github.io/react-shadow-root/

And both those two following lines of code, read and write, did work in console (F12) and in a userscript!

alert('document.querySelector("basic-demo").shadowRoot.querySelector("span").innerText: ' + document.querySelector("basic-demo").shadowRoot.querySelector("span").innerText);
document.querySelector("basic-demo").shadowRoot.querySelector("span").appendChild(document.createTextNode(" toto"));