commit c037d3558f41bd9be7c97056cb89ffcc801eabcf
Author: Ellington Santos <[email protected]>
Date: Fri Feb 23 13:23:51 2018 -0300
Surf link_hints script supports pages without predefined styles.
diff --git a/surf.suckless.org/files/link_hints.md
b/surf.suckless.org/files/link_hints.md
index fe086537..5d034300 100644
--- 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);