Hacker News new | ask | show | jobs
by angelaguilera 1483 days ago
This is really nice! May I suggest an option to "deobfuscate" certain parts of the web page? For example, after you obfuscate the page with alt+shift+O, then you could click on some parts of the page to de-obfuscate them. Sometimes you want to hide only certain parts of the page while keeping others untouched (page headers/footers, titles, etc.).
2 comments

Yeah I'd like to have that too. Don't know yet how I'd implement it, but logged here and happy to take Merge Requests: https://gitlab.com/vincenttunru/obfuscate/-/issues/3
Probably by

- locate the text node containing the selected text

- split the text node into 3 segment (the selected one in the middle)

- replace the selected segment with a span that has font style on it

?

I did something like this before to replace part of the text with a ruby tag.

https://codepen.io/mmis1000/pen/gOgKqba?editors=0010

Or probably you can do it the reverse the obfuscate the selected text and make it actually works like a black pen.

Although it will be definitely more complex because selection may cross multi text nodes. But the idea should apply.

Yeah, I was initially thinking block-level elements, but just selected text should be easier.
New release with an MVP implementation is now building! It's the opposite of what you described, but should fulfil roughly the same use case: if you select something and then hit the button, it will obfuscate (roughly) just that part of the page.
Being able to replace via regex or similar would be pretty killer for a lot of streamers who want to guarantee personal info or even usernames never appear on-screen in a browser.