sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit c037d3558f41bd9be7c97056cb89ffcc801eabcf
parent 0f41f0683eb841b61abd4f892bf2cd69115233e2
Author: Ellington Santos <ellingtonsantos@gmail.com>
Date:   Fri, 23 Feb 2018 13:23:51 -0300

Surf link_hints script supports pages without predefined styles.

Diffstat:
Msurf.suckless.org/files/link_hints.md | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/surf.suckless.org/files/link_hints.md b/surf.suckless.org/files/link_hints.md @@ -90,6 +90,11 @@ Code } function setHintRules() { + if (document.styleSheets.length < 1) { + var style = document.createElement("style"); + style.appendChild(document.createTextNode("")); + document.head.appendChild(style); + } var ss = document.styleSheets[0]; ss.insertRule('a[highlight=hint_elem] {background-color: yellow}', 0); ss.insertRule('a[highlight=hint_active] {background-color: lime}', 0);