html - Determine browser's default text highlight color using JavaScript or Dart -


the browser's default text highlight (selection) background color can overridden, e.g.:

::selection {   background: #ffb7b7; } 

and the color browser/os specific. there way read browser's default value using javascript or dart?

i can't.

both getcomputedstyle(yourelement, '::selection').backgroundcolor , getcomputedstyle(yourelement, '::-moz-selection').backgroundcolor return transparent default value , browser won't override os's default.
(worth mentioned if you set transparent, default os' value overriden).

i don't think browsers have access os default preferences, , if do, won't let website access it easily.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -