Browser-Phone icon indicating copy to clipboard operation
Browser-Phone copied to clipboard

Set Status and HTML code

Open vieridipaola opened this issue 2 years ago • 5 comments

friendlyState = friendlyState.replace(/[<>"'\r\n&]/g, function(chr){

is OK to avoid code injection, but it does not allow for "safe?" HTML code such as fontawesome icons. eg. &nbsp;<span style="color:orange;"><i class="fa fa-hand-spock-o"></i></span>&nbsp;<i class="fa fa-phone"></i>

Would it be possible to allow for HTML code (maybe filtering out potentially disturbing formats/tags) but not javascript code?

vieridipaola avatar Nov 23 '22 00:11 vieridipaola

I'm thinking the (emoticons) unicode characters are more platform compatible and "nicer" than the font-awesome, not so? eg: 🖖🏼 📞

InnovateAsterisk avatar Nov 23 '22 06:11 InnovateAsterisk

Ah, yes, very good point. Was never fully aware of what the emoticon world had to offer... Will do. Thanks!

vieridipaola avatar Nov 23 '22 09:11 vieridipaola

BTW you wouldn't happen to know how to change the color of an emoticon? eg. 👌🏻 makes the thumbs-up a bit lighter, but how can I make it green or red or whatever? HTML span styling is easier of course. I wonder if I can easily change an emoji color.

Sorry if this question goes beyond the scope of Browser Phone...

vieridipaola avatar Nov 23 '22 09:11 vieridipaola

On Mac, you click and hold until the option appears:

image

InnovateAsterisk avatar Nov 23 '22 15:11 InnovateAsterisk

Yeah, I get there's a way to customize (skin), but no easy out-of-the-box way to show eg. the same hand in different colors such as red, green, yellow, etc. Fontawesome icons work great with spans. I don't need to do any extra work.

Would it be possible to have a Browser Phone setting regarding "securing" the set status function? For instance: a "strict" setting would apply what phone.js is currently applying, but a "loose" setting would block javascript but allow HTML. How to do that... well, I don't know but a regexp that would search for the "script" tag would be enough I guess. Sure, plain HTML can also create UI havoc if inappropriate, but it should not be a security issue.

vieridipaola avatar Nov 29 '22 09:11 vieridipaola