Username

I looked through MDN and noticed that there is now JS support on the desktop for desktop notification, but I did not see the possibility of styling it. (I understand that it has not yet received wide distribution.)

Is this option available?

I see in the specification that there are some properties, such as body, icon, and tag, which we can pass as parameters, but it does not look like we can pass HTML code into them and compile it. I see that they only accept strings, but wondered if anyone had figured out a way to style it, which I don't have.

dictionary NotificationOptions { NotificationDirection dir = "auto"; DOMString lang = ""; DOMString body; DOMString tag; DOMString icon; }; 

Use Case: Passing a URL and allowing the user to click the URL.

Here's the fiddle I played with.

Not an urgent need, just a more curious question.

+5
source share
1 answer

It would seem logical to consider this as a warning field, since it is also a popup. A warning field is a system object that cannot be styled and does not interpret text as HTML.

0
source

Source: https://habr.com/ru/post/1238665/


All Articles